3 ms·
I think it partly depends on what your input language is like. A nice aspect of targeting C is that it's portable to pretty much everywhere, has multiple good c
by _delirium 17y ago
I think it partly depends on what your input language is like. A nice aspect of targeting C is that it's portable to pretty much everywhere, has multiple good compilers, and is low-level enough that you can compile a lot of different constructs to it efficiently (though not everything). But you'll end up reimplementing nontrivial infrastructure and a runtime if you're compiling a high-level language; e.g., does your source language have garbage collection? Any sort of dynamic features? If yes, are they similar enough to the semantics of any existing language that if you targeted that language you might be able to piggyback on its features, e.g. use the target language's GC to do your GC? (The latter idea has some of the same pitfalls/advantages of internal DSLs.)