• I don’t know that much about Zig, but I think the parallels to Lua’s top-level to Zig’s comptime are not particularly strong. In Lua there is no difference between execution that happens inside a function vs execution that happens at the top-level, because the top-level is a chunk, which is a kind of function. If you could run Lua code at load time, then it would be analogous to comptime, but this is not what actually happens.

    Good article other than that.


    score 1 · canonical