Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> I'm curious as to why you think this is necessarily true ?

It's always going to be slower simply because it's two compilers rather than one. You're writing another file to disk, and reading it back in. The lexing and parsing has to be done over again.

C++ only works if it is a superset of your language. For example, suppose your language wants to trap integer overflow. C++ doesn't do that. Think of how you'd write a+b in C++ and check for overflow. It isn't pretty or efficient. Or suppose you wanted to do a computed goto. C++ doesn't have that. It's not easy or efficient to do rewrite it. (gcc has it as an extension.)

Suppose you wanted to use the BCD arithmetic type in the x87. You're out of luck using C++. Or the 80 bit reals in the x87. You're out of luck with many C++'s as they don't support that.

> if you don't compile to a language with exceptions then you need to make exceptions work from the very scratch.

Yes, not an easy task at all.

> there is no reason the overall approach can't work with other languages

You'll find, as a practical matter, that if you're using language X as the target of your language, it will inevitably constrain the semantics of your language to be that of X. You can't even do things like use a different function call ABI.

> It works when you need something working and you need it fast

I bet you'll get something working fast, but trying to get the last 25% working will consume much more time than if you used an existing, well-developed back end.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: