logoalt Hacker News

sfpotterlast Tuesday at 4:14 PM1 replyview on HN

What's the use case for a language like this?

I used to very down on C++ but have stopped caring quite so much... Just using C++ and restricting oneself to templates seems like a better bet than this. Or you could use D and have a language whose template experience is much better than C++'s...

Any language this is going to need debug info eventually. One could step through the generated C code, but this is much less pleasant than stepping through the original source.

I also wonder how name mangling is handled?


Replies

masotlast Tuesday at 4:21 PM

For me, it was just to have some fun seeing whether you can get the convenience of generics in C without blowing up the size of a "minimal standards-compliant compiler." E.g., Chibicc[1] is only a few thousand lines of code; adding Gamma to that would not blow it up by much. There's something aesthetically pleasing about knowing I can read the whole thing in a few days. Nothing like that is possible for C++ (or D?) AFAIK.

But yes --- for a real project I would absolutely recommend someone use D over this !

[1] https://github.com/rui314/chibicc

show 1 reply