I've been reading some articles on why Ruby has symbols and all that,
and one of the most interesting articles on this subject I've read
opines that Ruby has them because they are preparation for a future
metaprogramming environment as powerful as Lisp's [1]. I've been
experimenting with Lisp and Lisp-like languages for a while, and have
seen how a first-class macro facility similar to that of Common Lisp
can be incredibly useful, and am wondering if thought is being given
to providing a similar macro facility to Ruby. I am curious as to what
form such a system would take; would we have a syntax tree
manipulation API that allows one to manipulate Ruby programs as though
they were S-expressions?
If I may be so bold... I love Lisp in many ways, and Common Lisp macros
are incredibly powerful. Ruby can't match that yet... but boy are we
close. Actually, most of the metaprogramming is already there. Some of
the support (the MOP for example) is way better and more intricate than
CLOS. If you need to be convinced, take a look at the Rails source code.
You could probably not compress it much more even with Lisp.
Regards
Ola Bini
ยทยทยท
----- Original Message -----
From: Dido Sevilla <dido.sevilla@gmail.com>
Date: Tuesday, May 23, 2006 6:40 am
Subject: Metaprogramming, Lisp, Symbols, and Macros
To: ruby-talk@ruby-lang.org (ruby-talk ML)
I've been reading some articles on why Ruby has symbols and all that,
and one of the most interesting articles on this subject I've read
opines that Ruby has them because they are preparation for a future
metaprogramming environment as powerful as Lisp's [1]. I've been
experimenting with Lisp and Lisp-like languages for a while, and have
seen how a first-class macro facility similar to that of Common Lisp
can be incredibly useful, and am wondering if thought is being given
to providing a similar macro facility to Ruby. I am curious as to what
form such a system would take; would we have a syntax tree
manipulation API that allows one to manipulate Ruby programs as though
they were S-expressions?