Love seeing hacks like this. Writing any kind of type-level functions does make me feel like type-level TypeScript is just a clunky functional programming language, and that using a ‘normal’ language at compile time would be much nicer. Seeing Zig’s comptime opened my eyes to this, but I wonder if you could do this without any annotations at all.
I head you like type systems…
Love seeing hacks like this. Writing any kind of type-level functions does make me feel like type-level TypeScript is just a clunky functional programming language, and that using a ‘normal’ language at compile time would be much nicer. Seeing Zig’s
comptime
opened my eyes to this, but I wonder if you could do this without any annotations at all.Incredible
Is there any examples of doing this (purely string based) in any other language?