I can't speak to the quality of Zig's compile-time compilation, other than to comment and say the article is taking liberties with its use of the word unique. As other commenter's have noted, many languages have the feature. Instead I'm going to talk about a bunch of cool and weird compile-time code implemented by people much smarter than I.<p>If anyone reading this is interested in compile-time computation, you owe it to yourself to read Paul Graham (of HN)'s own work on compile time programming, "On Lisp"[0], or to take compile-time ideas to the next level, Doug Hoyte's "Let Over Lambda"[1] (LOL). Lisp languages have a long and interesting history of compile-time computation via their various macro systems, and given the first-class inclusion in most Lisps, a greater variety of ideas have been explored regarding compile-time computation.<p>A few interesting examples:<p>LOL's "Pandoric macro"[2] lets you monkey-patch closure values. It's absolutely bonkers and would almost certainly be pathological to introduce to a codebase, but it's an example of pushing the boundaries of what's possible.<p>Common Lisp's object system, implemented via macro[3]. To be honest, the entire Common Lisp language is a masterclass when it comes to learning about macros (I can't avoid mentioning Scheme's hygeinic macro system and Lisp-1/Lisp-2.)<p>A special non-Lisp shout-out goes to Rust's Diesel library for embedding SQL DDL queries into macros[4] which is not something I've personally seen before.<p>Clojure has a few interesting (and practical) macro libs, particularly core.async, which is an implementation of CSP (similar to Golang's channels AFAIK), it embeds perfectly into the existing language and extends its capabilities even though it's merely a library. Another interesting lib which comes to mind is Meander[5], which uses term-rewriting to provide transparent data transformations. Think declaratively interacting with data structures at compile time, and the library figuring out the best way of turning it into imperative value manipulation code.<p>[0] <a href="http://www.paulgraham.com/onlisp.html" rel="nofollow">http://www.paulgraham.com/onlisp.html</a>
[1] <a href="https://letoverlambda.com/" rel="nofollow">https://letoverlambda.com/</a>
[2] <a href="https://letoverlambda.com/index.cl/guest/chap6.html#sec_7" rel="nofollow">https://letoverlambda.com/index.cl/guest/chap6.html#sec_7</a>
[3] <a href="https://mitpress.mit.edu/9780262610742/the-art-of-the-metaobject-protocol/" rel="nofollow">https://mitpress.mit.edu/9780262610742/the-art-of-the-metaob...</a>
[4] <a href="https://diesel.rs/" rel="nofollow">https://diesel.rs/</a>
[5] <a href="https://github.com/noprompt/meander" rel="nofollow">https://github.com/noprompt/meander</a>