Pharo 9.0 is released, and there's a ton in this release: https://github.com/pharo-project/pharo-changelogs/blob/master/Pharo90ChangeLogs.md
The community is growing and the tooling is improving at a really impressive rate. Pharo is increasingly its own language too, the way Racket separated from Scheme.
miniblog.
Here's an example where highlighting changed words in a comment is kinda distracting.
I think the right solution is to compute a levenshtein distance and only highlight changed words if the lines are sufficiently similar.
I'm dogfooding difftastic and I'm always pleasantly surprised when it works.
Here's a nice example from optimisation today: I've removed an outer if statement. Note that it's lined up line 47 on the left with line 41 on the right, even though they have different indentation.
I've been adding heuristics to difftastic for showing comment changes. See before and after.
It's a messy problem: do I split on spaces or word boundaries? Do I handle "reflowing" single-line comments where a word is added to a sentence and several comments change?
Difftastic is getting closer to being a tool that I can recommend for daily usage! I've just tagged v0.4: https://crates.io/crates/difftastic
This release includes much smarter diff logic, considering newlines and nesting depth to produce more comprehensible diffs. It's faster too :)
Spent some time today trying to replace difftastic's implementation of Dijkstra's algorithm with A* search.
I got a working implementation that passes tests: https://github.com/Wilfred/difftastic/commit/9a271169f68cdb678efe2035f5a4e45daeb6533d but sadly it's no faster. My slowest files still take 1.5 seconds with similar memory.
How do you tell if a computer game is being played by a human or a computer?
Trackmania allows you to replay every keystroke. Enthusiasts have reverse engineered the game and measured what the fastest possible inputs are possible by hand!
https://donadigo.github.io/tmx1
It's wonderfully easy to switch out the allocator in Rust: https://doc.rust-lang.org/edition-guide/rust-next/no-jemalloc.html
Sadly it didn't help difftastic performance despite doing a lot of allocation, but it's really easy to try it!
Difftastic update: It now prefers matching nodes of a similar nesting level. This seems to help when there are multiple possible minimal diffs.
Left is before, right is after. I think it's an improvement overall, but golly the output can become inscrutable sometimes.
Running a CPU emulator the "modern" way, with Kubernetes cluster of microservices for each opcode! https://blog.davetcode.co.uk/post/21st-century-emulator/
Efficiently generating random numbers in an interval 0-N https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/
The article demonstrates rejection sampling and bit masking. I've hit this problem a few times in property-based test frameworks, so it's nice to see solution techniques.
It's amazingly awkward to print a syntactic diff correctly. Even the lines before and after the changes may not line up, if whitespace has changed!
Difftastic now inserts blank lines to help things line up. I'm reasonably happy with the result here.
Haskell Wingman is a fun project that provides hole-based refinement to any editor that speaks LSP!
It's a great example of how to describe complex features in terms of user benefit too.
https://haskellwingman.dev/
I've been playing with 'sliders' in difftastic, the classic diff problem where you highlight an adjacent value that is correct but weird.
I've taught difftastic to penalise sequences across newlines. This largely works, but it hurts perf (another degree of freedom to solve).
Interactive Sokoban, the 2D logic puzzle, on a non-Euclidean surface: https://sokyokuban.com/
Snorkel is a project that encourages you to build heuristic functions to train a ML model on. It's a clever alternative to manually labelling data.
https://www.snorkel.org/use-cases/01-spam-tutorial
Sadly `git difftool` invokes your tool once per file. This makes it hard to print whitespace between files.
I'm experimenting with adding an extra newline at the end of output, but it feels a bit untidy for the single file case.
Difftastic update: I've rewritten the tree diffing logic to use Dijkstra's algorithm similar to Autochrome.
It works amazingly well! Note how it recognises both parent and children unchanged nodes in the lisp example. You can even see me refactoring Rust to use if-let.
Neat GitHub feature I haven't seen before: if the contributing guide has changed since your last pull request, it tells you!
Plain data in Rust can be surprisingly verbose.
I thought I wanted:
enum Action { Changed, Unchanged }
but it turned out I wanted this instead:
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
enum Action { Changed, Unchanged }
Showing 161-180 of 345 posts