Today I learnt that Cell<T> has the size of a pointer (i.e. probably 64 bits) in Rust, regardless of the size of T.
It's a common pattern for making struct fields mutable, but the T isn't actually stored inside the struct.
miniblog.
Related Posts
In LSP, a position is represented as a line number and a column offset (in Unicode code units): https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position
This is pretty elegant. You'll get the correct line regardless of encoding bugs, and the editor already knows the line number so it's cheap to compute.
The TypeScript docs have IDE-like hover types on all the examples, which is really impressive.
I also like how the second example always shows the type of the relevant part, regardless of mouse position. It's clear and mobile friendly.
Screenshot from https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types
Why swap is still relevant on modern systems, regardless of the amount of RAM available: https://chrisdown.name/2018/01/02/in-defence-of-swap.html

