miniblog.

Rust's Iterator interface is growing on me. I replaced a bunch of `i += 1; foo.get(i)` loops with explicit calls to `.next()`. It's less code and easier to reason about.
Photo
A delightful suggestion from the Rust compiler: you have no field of that name, looks like you need to access it via another field! Adding a snazzy compiler error is a rarely used feature (in each individual case), but it's wonderful when you hit that case.
Photo
I'm beginning to think this last sentence was a mistake. Lots of software fixes crashes in new versions. Perhaps I should have a "N releases since last fix for a crash" count?
Photo
Difftastic 0.23 is out! I've been tuning diffing and display and I think the results look fantastic. * Parent delimiters are modelled accurately * Display uses blank lines as an alignment hint * Textual diffing is way faster too!
Photo Photo Photo
Anecdotally, I've noticed more frequent doc comments in languages that put them inside the function (e.g. Python, Lisp) rather than outside (JS, Rust). Perhaps it's easier to write the rough signature before the explanation?
I've finally fixed an issue where difftastic wasn't showing optimal diffs if you wrapped an expression in another expression. For example, lisp expression changes are super readable now :)
Photo Photo
It's weird how ! denotes side effects when it's allowed in names (Scheme, Ruby) but there isn't a clear equivalent in other languages. My only theory is that "side effects" is often vague. list-add!, table-drop! and ping! are very different effects.
An overlooked PL question: what is easy to try in a given language? In lisp it's easy to try adding extra syntax. In Rust it's easy to try parallelism on iterators (rayon). Are there other examples? Perhaps Perl and regexes or Haskell and STM?
I've found an interesting case where difftastic and GitHub diff results are pretty different. I've replaced some function calls with a DiffResult and the matching is a bit aggressive, but showing `diff_directories` changes is really nice. (Commit shown: https://github.com/Wilfred/difftastic/commit/4883edd90cc8011041a6cee0622805d6bc7847a0)
Photo Photo Photo
Writing an IRC server, exploring object systems, and enabling hot reloading for clients: https://technomancy.us/197 (in Lua and Fennel)
Contrasting the C++ committee with Rust's RFC process, and avoiding antagonistic design evaluation: https://www.reddit.com/r/cpp/comments/td5np8/to_save_c_we_must_save_abi/i0hsxod/
There's something of a tradition of REPLs having personalities in lisp. I've seen Common Lisp tools (e.g. slime/sly) and Clojure (e.g. cider) say encouraging things, but Fennel is almost judgemental :)
Photo
Sometimes a good bug report is just nerd sniping.
I'm finally reaching a point with difftastic where I'm pretty happy with performance. 0.22 has some effective heuristics for making the tree diff faster, and 0.23 will have Myers' diff algorithm for text.
Really elegant way of understanding macros: generate railroad diagrams for them!
Photo
I've released difftastic 0.22! * Added PHP, and improved C++ and Rust * Files are split on clearly unchanged regions before diffing, hugely improving performance * A ton of improvements to nested diff heuristics
Photo Photo
Flamegraphs are an indispensable tool, but sometimes I overuse them. Here's an example for difftastic -- it spends most of the time computing the shortest path. I was able to make the diff graph smaller, making difftastic much faster -- but the new flamegraph looked the same!
Photo
Difftastic uses the same parse tree for diffing and highlighting. This has a really nice side effect: you can spot parsing bugs from highlighting! It's subtle, but difftastic shows parentheses/braces in bold. I noticed that < and > weren't bold, and fixed the parser :)
Photo
It makes sense to worry about writing code that is accidentally quadratic. Turns out you don't need to worry about accidentally exponential code. It's painfully obvious.
Google now makes data available on common streaming times and ISP quality by location!
Photo
Showing 281-300 of 384 posts