miniblog.

Difftastic 0.20 is out! * Better handling of nesting changes, based on autochrome. This fixes some nasty corner cases (Python screenshot) and gives nicer results in general (Scala screenshot). * Better handling of large files, even multi-megabyte!
Photo Photo Photo
RISC-V seems like a great example of "commoditise your complements". If you're getting value higher in the hardware or software stack, a royalty-free ISA is valuable. Creating an ISA is a ton of work. Once it's basically viable, it creates interesting opportunities.
I really like languages where private functions are fewer keystrokes than public functions. Unfortunately 'protected' is longer than 'public', or 'pub(crate)' and 'pub'. Have any languages solved this? E.g. 'fn foo', 'pkg fn foo', 'public fn foo' would work.
Robin Hood hashing, and a remarkable bug in Rust where building one hash map from another can have quadratic performance! https://accidentallyquadratic.tumblr.com/post/153545455987/rust-hash-iteration-reinsertion
@janriemer@mastodon.technology @friend Not spam at all! Thanks, I'd not seen that, and it looks really well suited to my needs :)
@friend @janriemer@mastodon.technology Sounds like a good choice! I recently found this interesting benchmark table which shows Blake as a great cryptographic hash: http://cyan4973.github.io/xxHash/ (FWIW difftastic uses rustc-hash for its hashing needs.)
Git repositories have the lovely properties that deletes aren't propagated. Shared/cloud storage sync deletes across devices. Accidentally deleting content in a local git repo, and even pushing it, is a safe operation.
Fun fact: for simple text diffs, difftastic is now constrained by terminal output performance! I halved instruction counts for diffing a 300KLOC text file against "" and I only went from 8.2 seconds to 6.5 seconds.
Most of the code I write is in a garbage collected language. I'm often surprised how much extra performance I can get when I can control allocations. I saved ~10% runtime in difftastic by moving to a zero-allocation colour library (owo_colours)!
My Rust rule of thumb: if there are no lifetimes in your return type, you probably don't need to specify the lifetimes in your arguments. (I know clippy will point out simple cases of unnecessary lifetimes, but plenty other cases occur IME.)
What's your favourite file checksum when you don't need cryptographic strength? md5sum is convenient (it's installed on most systems), but it was originally intended to be secure. I just want a fast content check. (Or is sha256sum sufficiently optimised that it doesn't matter?)
tree-sitter is wonderful, but it struggles if you try to parse its own output files. In fairness, parsing a multi-megabyte C file is hard. The C# parser has a parser.c file totalling 18MiB!
Difftastic 0.19 is out! In this release: * Vastly improved syntax highlighting! * Smart fallback to textual diffing for extremely large files * Many smaller bugfixes:
Photo Photo Photo
rustc is the only self-hosted compiler I've seen that uses external packages in the target language. Are there others?
I refactored some Rust string splitting logic: old: &[&str] -> Vec<String> new: &[&str] -> Vec<&str> It's a little faster, but it's an interesting type signature. You can figure out more of how the new one works! It must be slicing into the input string.
One underrated advantage of ORMs: it's significantly harder to write code vulnerable to SQL injection.
Bytecode interpreters vs tree walkers, and beating GNU Awk performance in GoAWK: https://benhoyt.com/writings/goawk-compiler-vm/
Ooh, today I learnt that terminals support italics! Difftastic now uses italics for comments. Bold/italics are great because they're still visible even when you're showing text in green or red. They compose nicely :)
Photo Photo
tagref is a cute tool where you write `// see [tag:foo] and it ensures that `[tag:foo]` actually exists somewhere in your codebase. https://github.com/stepchowfun/tagref
"Minus 100 points", an article on deciding how to add features C#, remains one of the best introduction to PL design principles I've seen: https://docs.microsoft.com/en-us/archive/blogs/ericgu/minus-100-points (Design is hard, combinatorial complexity grows easily, saying "no" needs to be a default.)
Showing 801-820 of 7,506 posts