New kid on the block / introduction

Armin Rigo arigo at tunes.org
Sat Nov 4 03:41:04 PST 2006


Hi Tom,

On Thu, Nov 02, 2006 at 07:25:30PM -0500, Tom Novelli wrote:
> Couldn't you write a Ruby-to-Lisp parser?  If that
> works, I think you could create a stripped-down version of SBCL, load
> your parser, and save out a modest-size executable... and if it works
> for Ruby, it ought to work for Python, Javascript, etc.. and they'd
> all share the same garbage collector, native code compiler, etc.

Newsgroups like comp.lang.python are full of statements like "just
implement Python in Lisp and everything will be great".  By now, you'd
think that someone would really have tried, but there is no such
implementation showing great results - even as a prototype.

It doesn't work.  There are several reasons for that.  One reason (try
google for more detailled answers) is that Python, Ruby, etc. are 3%
syntax, and 97% semantics defined by a large library.  It's trivial to
translate the AST of these languages to S-exps, e.g. with a Ruby-to-Lisp
parser.  Then you only solve 3% of the problem.  The difficult and
tedious bit is to implement the semantics and library and object model,
and Lisp compilers are not going to magically make these 97%
super-efficient.  (I should add that I consider the 3% the boring bit;
parser generation stuff was solved decades ago, but sadly many compiler
construction lectures still focus mostly on that.)


A bientot,

Armin



More information about the TUNES mailing list