miniblog.

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
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.
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.
Photo
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.
Photo
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?
Photo Photo
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.
Photo Photo
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.
Showing 1,021-1,040 of 7,508 posts