4 ms·
No name mangling by default, far simpler toolchain, no dependence on libstdc++, compiles faster, usable with TCC/chibicc (i.e. much more amenable to custom tool
by dboon 11mo ago
No name mangling by default, far simpler toolchain, no dependence on libstdc++, compiles faster, usable with TCC/chibicc (i.e. much more amenable to custom tooling, be it at the level of a lexer, parser, or full compiler).
C’s simplicity can be frustrating, but it’s an extremely hackable language thanks to that simplicity. Once you opt in to C++, even nominally, you lose that.
- phs2501 11mo agoI highly doubt (and some quick checks seem to verify that) any of the tiny CC implementations will support the cleanup extension that most of this post's magic hinges upon. (Agree on your other points for what it's worth.)
- fuhsnn 11mo agoTinyCC supports cleanup[1], onramp[2] supports C2y defer (which is a superset), slimcc[3] supports both. [1] https://godbolt.org/z/hvj9vcncG https://godbolt.org/z/hvj9vcncG [2] https://github.com/ludocode/onramp https://github.com/ludocode/onramp [3] https://github.com/fuhsnn/slimcc https://github.com/fuhsnn/slimcc