4 ms·
Ruby 'compiler' in Common Lisp
- ohyes 16y agoAnother interesting example of a program like this is CLPython: http://github.com/franzinc/cl-python http://github.com/franzinc/cl-python It is too bad that more language implementors do not go this route, as it is a really easy way to get decent efficiency. I suppose it isn't surprising, however. It is a lot easier to find people willing to contribute to open source C/C++/Java code than Common Lisp. I will note this implementation and does not have a lot of the important functionality involved in classes/modules and their scoping (so pretty much any of the language semantics, which is understandable as it is a toy). Implementing the semantics of the language, would be trickier and probably lead to less efficient code.
- regularfry 16y agoNeat trick. Still, it's like Charles Nutter said - it's easy to make a fast subset of ruby by chopping off inconvenient corner cases. It's really, really hard to make a fast ruby.