I just thought I should share this link.
http://voodoo-slide....plifying-c.html
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.
Amplifying C with Lisp
Started by geon, Jan 29 2010 04:38 PM
4 replies to this topic
#1
Posted 29 January 2010 - 04:38 PM
#2
Posted 29 January 2010 - 08:19 PM
edit:
Sorry, I misinterpreted the article.
Sorry, I misinterpreted the article.
#3
Posted 29 January 2010 - 09:03 PM
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 suchlike.
As for Lua, uh, what?
Of course, you could write a Lua-to-C compiler too if you liked.
As for Lua, uh, what?
reedbeta.com - developer blog, OpenGL demos, and other projects
#4
Posted 29 January 2010 - 11:39 PM
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.
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.
#5
Posted 29 January 2010 - 11:43 PM
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.
reedbeta.com - developer blog, OpenGL demos, and other projects
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












