Computer Things

Subscribe
Archives
  Back to the email
Techno Utopia
Aug. 23, 2025, morning

👋 Hi Hillel, long time no talk!

I was remembering this post of yours while I was writing Zig; Ironically, I see Zig as the most dynamic language I've used in recent years (and I used a lot; python, js/ts, go, java, etc...). And you are right; most languages are becoming more static, or at least static within what the typesystem can express.

A lot of literature on zig comptime out there (and a lot of fanboys and fangirls), but I think the biggest analogy I can draw is; Zig is reverse-typescript. In Typescript, types aren't "real" and they get erased away, so you're left with the same js code, that just conforms to more restrictions (that helps you with writing more structured code). In Zig, the popular way of doing metaprogramming is via comptime, and most of comptime is duck typed, akin to the C++ templates; for example, while constructing generic structures, there's no fancy covariant / contravariant that many typed languages have;

Zig still gets compiled, and that's why it's "reverse-typescript". the code you write is heavily duck-typed, but the generated code must compile in machine-efficient manner, and compilation must pass after the code generation. This allows you do do some crazy stuff, and it is really disorienting yet thrilling after N years of "mostly-static" programming to jump back to this.

Reply Report
Powered by Buttondown, the easiest way to start and grow your newsletter.