miniblog.

I'm still trying to get a good solution for side-by-side display in difftastic. I'm experimenting with .. for line numbers, so it's more obvious when a hunk begins and ends. (I toyed with -- instead of .., but - really risks confusion in a diff tool!)
Photo Photo
If function f1 is unused, and f2 is only called from f1, Rust complains that both f1 and f2 are unused. I find this confusing: it's useful to know that I can remove both functions, but removing f2 alone gives a compile error. Not sure what the best tradeoff is though.
Exciting to see Google advocate for a standard linear smear for leap seconds! Smearing feels like the best solution, we just need consensus on how to do it. https://developers.google.com/time/smear
prism.el is an excellent highlighter that uses nesting depth: https://github.com/alphapapa/prism.el It has some really compelling screenshots (e.g. it makes the funcall more obvious here) and even works for non-lisps!
Photo
On the nuances of Rust inlining, crate boundaries, and what gets inlined by default: https://matklad.github.io/2021/07/09/inline-in-rust.html
Good news: it's super easy to add LTO to Rust projects, and only added 60 seconds to difftastic's link time: [profile.release] lto = true Bad news: It only reduces the difftastic runtime by ~5%. At least it didn't require much wrangling to try :)
I've started experimenting with inline displays for difftastic. It handles long lines way better, and your eyes don't need to jump around as much. Here's a mockup of the display I have in mind, along with today's side-by-side display.
Photo Photo
I used to think repositories with multiple packages were a niche feature (cargo workspaces in Rust, Lerna in JS), but they're really valuable for the ecosystem. Large projects will naturally develop mature, reusable code. Making it easy to release their helpers is worthwhile.
rust-analyzer has a really cute feature "highlight related". It will highlight the enclosing loop when cursor is on `break`, or the enclosing `async` when cursor is on `await`: https://github.com/rust-analyzer/rust-analyzer/pull/9678
I've just released difftastic 0.6! Comment diffing is now much smarter, output alignment is way improved, several major crashes have been fixed, and I've even added Go support :)
Photo Photo
A cute feature in Pharo 9: dynamic rewriting of deprecated methods! The code and runtime are so closely integrated that you can use test execution to automatically update call sites. https://github.com/pharo-project/pharo-changelogs/blob/master/Pharo90ChangeLogs.md
Visual Studio is adding GMail-style predictive code completion, using an ML transformer model. Unlike GitHub Copilot, it seems to focus on smaller code snippets and leverages the surrounding code context. The examples generated seem less surprising. https://devblogs.microsoft.com/visualstudio/type-less-code-more-with-intellicode-completions/
Some high end GPUs are being bricked by a new game: https://www.tomshardware.com/news/evga-replacing-all-dead-rtx-3090s-from-new-world Sounds like it draws too much power, then something overheats or dies internally. Hardware dying from software seems really old fashioned, so it's interesting to see it happen on modern components.
Rust has a lot of integer types, but I kinda like distinguishing u64 from usize. It communicates intent. A usize is probably going to be used as an index, whereas a u64 is probably just a measurement of something.
There are a ton of LSP implementations for lots of languages. Do you have a favourite? What makes a language server particularly good?
I've been learning more about refactoring operations ("code actions") in the Language Server Protocol and they're more limited than I realised. An action is basically a name and an edit. There's no scope for prompting the user or offering GUI options.
I've released difftastic 0.5! It now works with arbitrary git commands, which makes it far more useful. Parsing is improved, diffing is *way* smarter, and it's faster too! Full changelog: https://github.com/Wilfred/difftastic/blob/master/CHANGELOG.md#05 (It's also less crashy, but it still panics on binary files.)
Photo
Syntactic diffs can get confused by adding whole functions. I've added two functions and modified the function afterwards. Difftastic would associate the parens of the new function with the outer parens of the modified function! This is "correct" (minimal edits) but unhelpful.
Photo Photo Photo
It's now possible to use difftastic for all your git diffing operations! I'm using `git log -p` in this screenshot. (It crashes horribly if you add/remove whole files, or modify binary files, but it's really nice to dogfood and spot issues!)
Photo
I tried a Fibonacci heap for my implementation of Dijkstra's algorithm, but it ended up being slower! Apparently this is a common thing and Fibonacci heaps are very rare in practice: https://stackoverflow.com/q/30782636/509706
Showing 141-160 of 345 posts