I just thought I should share this link.
While I don’t have that much experience with neither C nor Lisp, being
able to generate plain low-level C while having the advantage of the
high-level functional Lisp seems awesome.
Please log in or register to post a reply.
Sorry, I misinterpreted the article.
Very interesting. I’ve contemplated the idea of having a high-level
language compile to C as a target language before, but never seen a
complete system that does it. It’s certainly a useful idea if you want
to create your own language generally (not just Lisp-based things). As
the article points out, C compilers/libraries exist for just about every
platform out there, so by compiling to C your language is immediately
cross-platform (assuming you only need cross-platform libraries) and
gets the benefit of very mature optimizers, code generators and
As for Lua, uh, what? :) Of course, you could write a Lua-to-C compiler
too if you liked. :)
Well, it’s not really compiling Lisp to C.
You would actually write C code in Lisp syntax, giving you access to the
extremely powerfull Lisp macro system. That way you can do stuff like
resource management and exception handling by transforming the C code.
You would then compile your Lisp-ish C into plain C.
Writing “C code in Lisp syntax” sounds pretty much like writing Lisp to
me. :) Yeah, maybe you’d have calls to the C standard library instead of
the Lisp one, but that’s a minor detail.