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`: github.com/rust-analyzer/rust-

Difftastic now handles several of these cases (see first screenshot), but there's a bunch more to be done in this area alone!

Show thread

Diffing comments is a really interesting problem.

You want word diffs when lines are sufficiently similar, but sometimes adding a word causes the comment to reflow.

Indenting a multiline comment changes its inner content, and sometimes doc comments have special syntax.

Show thread

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 :)

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.

github.com/pharo-project/pharo

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.

devblogs.microsoft.com/visuals

Some high end GPUs are being bricked by a new game: tomshardware.com/news/evga-rep

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?

Refactorings like 'reorder parameters' are very hard in this model. 'Extract method' can cheat by triggering a rename immediately after.

LSP feels a little like JSON: effective, tons of polyglot support, but sometimes feels a bit limiting

Show thread

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.

Why use unix and just get a shell, when you can use logo and have the whole turtle?

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: github.com/Wilfred/difftastic/

(It's also less crashy, but it still panics on binary files.)

My current solution (the second screenshot) is to prefer marking large whole trees as novel rather than having <10% of nodes unchanged in a largely novel list.

The XML diff literature debates between "optimal" and "fast" diffs, so I'm surprised to see that optimal isn't enough!

Show thread

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.

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!)

On the plus side, there are Rust implementations of FibonacciHeap whose API is very similar to the stdlib BinaryHeap. It's very easy to give it a try.

I used docs.rs/rudac/0.8.2/rudac/heap

Show thread
Show older
Mastodon

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!