Exploring design ideas using AI as a learning assistant, for creative exploration:
Wilfred Hughes
Installed Linux on a new laptop yesterday, and needed to find a USB stick in a dusty drawer.
The stick previously had Arch Linux Installer 2021 on it! I can't think of any other uses for the device these days.
Wilfred Hughes
It's always seemed odd to me that the Rust stdlib is so lean (no random numbers, regex, HTTP) yet clippy is so big (correctness, performance, style preferences, even 'too many arguments').
Maybe it's because cargo is mature but clippy doesn't have an extension ecosystem?
Wilfred Hughes
USB-A connectors seem absolutely massive when the majority of my connectors are USB-C. With hindsight, maybe the original USB standard could have been smaller.
USB 1 came out in 1996, way before the modern smartphone, so I assume it was more focused on desktop devices.
Wilfred Hughes
I'm still trying to find a sweet spot between 'show the general syntax' and 'show a concrete example' in the CLI docs for difftastic.
https://difftastic.wilfred.me.uk/usage.html
I'm currently showing the syntax, immediately followed by an example. What do you think?
Wilfred Hughes
I've release difftastic 0.58:
* Updated C, C++, CMake, CSS, Elm, Go, Lua and Python parsers
* Better diffs when files have parse errors
* Polish: CRLF handling, obscure terminal detection, and a man page!
Wilfred Hughes
Noodling with an interpreter for a statically typed language with reified types (e.g. a list knows what type it contains).
Currently I have a single representation of types in both the runtime and the type checker. I think that's a good thing?
Wilfred Hughes
I still find it weird that constructors aren't first class functions in OCaml.
`id Just` is legal in Haskell, but `id Some` is an error in OCaml.
Are there any advantages of the OCaml approach?
Wilfred Hughes
I tried replace Vec with SmallVec in a really hot loop in difftastic, and it's a huge speedup. It almost *halved* the runtime of one of my test files!
I've done a lot of performance tuning of difftastic, so it's surprising to see such a big win.
https://crates.io/crates/smallvecWilfred Hughes
I've written my first man page!
https://github.com/Wilfred/difftastic/commit/cb63ca88303d3c8dffd763cf6e5772e45c045588
Troff syntax is new to me and a little hard to read -- apparently you shouldn't use blank lines. Turns out you can use pandoc to convert markdown to troff instead.
Wilfred Hughes
Watching
https://youtu.be/KWB-gDVuy_I and I'm struck by how weird constructors are as an API.
* They promote total functions, making it hard to do validation.
* They're hard to split up, because they have special access to unfinished data.
* They're like a framework: you get called.
Wilfred Hughes
Amazing blog post about running a modern Linux kernel on Chumby hardware, investigating bad CPU numbers from top, and finding a Linux kernel bug from 2009!
Wilfred Hughes
It's weird how even pure languages tend to treat the Unix execution model as ambient state.
Are there any PLs that define a main function like this?
fn main(args, stdin, stdout, env) -> exit code
Wilfred Hughes
I've written a very small, very bad, type checker for my toy programming language. Within three days, it found a bug in a program I was writing!
Wilfred Hughes
I think software maintainers can perceive their projects as way more buggy than they actually are.
You spend more time looking at the bug tracker, which is (hopefully!) not representative of typical usage.
Wilfred Hughes