Metalang99: a rich functional language implemented in C99 preprocessor
19 points by whitequark
19 points by whitequark
This is a basis for https://github.com/Hirrolot/datatype99 (from the same author). Which is equally impressive and cursed :)
this is fascinatingly cursed; thank you for sharing it
I feel like lots of "healthy" C projects end up with this kind of destructuring macro system... having everyone use the same one feels like it would be a gain for most people.
I weep for programming languages trying to translate this (zig's translate-c for example)
Why is that? In the worst-case scenario, wouldn't you just run the preprocessor and feed the result to translate-c?
Yes you can do that. But often more than not the CPP macros and constants are part of the library API and having those preprocessed makes using the library more inconvenient. So you either have to replicate those macros in the host programming language, or akwardly use the C library.