Re:ClojureC, a compiler for Clojure that targets C as a backend
by coldtea on Sunday May 05, 2013 @02:54PM
(#5659323)
Sure, I agree about this: "C provides an easy-to-read intermediate format, and is simple to generate, as other benefits. Not having to deal with a massive C++ codebase is another.".
So portability and less dependencies, plus easier.
As someone who has written more than one compiler, I don't see how it is self-evident at all. It's also not at all that common-place compared to generating C or asm output textually.
> It's about having more structure and less of an ad-hoc pipeline, which helps with better tooling, error prevention, etc.
Those provide some benefits, sure. At the cost of massive amounts of complexity in the case of LLVM.
> The only benefit to using C for something like this is portability, which is something else altogether.
Now it is you who are wrong. Other people have already pointed out, for example, that C provides an easy-to-read intermediate format, and is simple to generate, as other benefits. Not having to deal with a massive C++ codebase is another.
You may disagree that these other benefits are worth it, but for me at least they are (just taking a break from a compiler that generates textual asm because I find even that preferable to dealing with LLVM).