miniblog.

It's a shame that programming languages take a while to write. I have so many ideas!
I'm adding C support to difftastic, and it's showing some really interesting examples of tree diffing. In this case, difftastic considers the second `+` in `x + colwidth + diff` to be unchanged. This is because `+` is right associative in C!
Photo
I'm delighted to release difftastic 0.9! https://crates.io/crates/difftastic In this release: * Added support for TypeScript, TSX and Elixir * Improved Rust, Clojure, CSS and plain text * Added a manual: https://difftastic.wilfred.me.uk/ * Performance improvements (~40% cumulatively I believe)
Today I learnt about radix heaps! They're a faster min-heap when your values are monotonically increasing -- perfect for Dijkstra. It saved 15% runtime for difftastic :) Wikipedia reference: https://en.wikipedia.org/wiki/Radix_heap The library I'm using: https://en.wikipedia.org/wiki/Radix_heap
Computing AMD-specific instructions on Intel by just brute-forcing the whole execution space and seeing which values differ: https://robert.ocallahan.org/2021/09/emulating-amd-rsqrtss-etc-on-intel.html
Took me a while to figure out how to debug a hanging Rust test. The best invocation seems to be: $ RUST_TEST_THREADS=1 cargo test -- --nocapture This will print test names before execution, so you can see where you're hanging. --nocapture lets you see print output immediately.
I've factored out the Vector and Edge definitions in difftastic so I can experiment with different graph search algorithms! It's so much easier when you can toggle between them. So far A* is only 10% faster than Dijkstra, but I've found an additional 20% win that benefits all :)
rf for Golang is a really elegant CLI refactoring tool. You use shell style commands for code changes! $ rf 'mv T.Field T.field' https://pkg.go.dev/rsc.io/rf
I've written a manual for Difftastic with mdbook! https://difftastic.wilfred.me.uk/ mdbook makes it super easy: it auto-creates stub files, and reloads your browser as you write. It's a really nice workflow.
Do compilers ever transform pairs of malloc/free? E.g. in a loop: p = malloc(32); foo(p); free(p); In principle this doesn't need to be allocated on the heap.
I'm writing ASCII diagrams for docs. It's not terribly pretty, but it's so easy to contribute to. I've seen so many beautiful architecture diagrams go stale because no-one wants to find the file and the GUI tool to keep it updated.
Photo
mdbook is a popular tool for Rust projects to document how they work: https://github.com/rust-lang/mdBook/ I suspect the name really helps: "writing a book" sounds much more impressive than "writing some docs"!
Neat GitHub bot that uses ML to infer whether a task is a bug, a feature request or a question: https://github.com/marketplace/issue-label-bot The bot is no longer available as a service, but the source is available: https://github.com/machine-learning-apps/Issue-Label-Bot
Superb deep dive on rust compile optimisation with CI caching, examining usage of monomorphisation, and graphing the build tree: https://matklad.github.io/2021/09/04/fast-rust-builds.html
Adding a new language to difftastic is straightforward, but it requires some configuration and testing. I just started with languages I've recently used. I'm trying to be more quantitative and use GitHub data: https://madnight.github.io/githut/ What languages would you like to see?
I'm delighted to announce difftastic 0.8! In this release: * tree-sitter parsers are much improved and now the default * added support for Python and Java * better handling of added/removed files
Photo Photo
"When your Rust code breaks, look at unsafe blocks." I initially parsed this as "consider adding unsafe blocks"! Turns out they meant "crashes are more likely to be caused by existing unsafe blocks". Phew.
Applying PGO to rustc (on both LLVM and the Rust-based frontend) can provide a ~10% improvement to compile time! https://blog.rust-lang.org/inside-rust/2020/11/11/exploring-pgo-for-the-rust-compiler.html This has been recently merged to Rust's CI: https://github.com/rust-lang/rust/pull/88069
Taking a break from debugging graph traversal algorithms to give difftastic a logo :)
Photo
One problem with syntactic-based diff tools (like difftastic) is that they can show confusing results when replacing a function. I've realised that traditional diffs have the same problem! There's one common line between old and new, and diff has matched the closing parens.
Photo
Showing 961-980 of 7,508 posts