Typescript's union types are really nice for writing interpreters.
type Value = NumberValue | StringValue;
function add(array<Value> args): NumberValue { ... }
I often find that primitive functions get little checking (e.g. just returning a Value) in the host language.
miniblog.
Related Posts
The literal 0xffu8 in Rust is pretty tricky to read without syntax highlighting. It looks like a plain hexadecimal value at first.
(Why not have syntax highlighting? Ironically I was debugging and improving VS Code's Rust highlighting.)
What's the nicest way of doing clientside form validation without annoying the user?
I keep finding forms that show red errors when I write 'wilfred@' for an email or '0' for a telephone number because I haven't finished inputting the value.
Excellent series on Self, both the programming model and the tool chain.
I love how opening an inspector on a value (e.g. nil) then shows a link to all occurrences of the value in other open inspectors!