lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Scheme is a great language--a language designed for computer scientists and experienced programmers to play around with new ideas.  Lua is a widely used extension language for general users.  Once macros are available in a programming language, readers can tell much less about what a piece of code does than if macros are not available.

Most uses of macros can be handled more cleanly with a compact lambda or block construct, plus some simple operators.  I think Lua already has pretty good support for that, but maybe a more Smalltalk/Ruby-like block syntax could improve things a little further.

Cheers,
Thomas.

On Aug 17, 2007, at 6:44 AM, Evan DeMond wrote:


Possibly also: macros (in the LISP sense).

Having received a lot of training in the dark arts of Scheme, this idea is the most tantalizing to me so far (can't believe no one picked up on it yet!), but:

* I'm not sure how it'd fit in with Lua philosophy. In its favor, it's an extremely powerful generic tool upon which a lot of things could be implemented; this seems to me in keeping with the rationale behind Lua's generic structures such as tables which support a slew of different programming paradigms. However, would we just be muddling Lua's identity up too much with the realm of functional languages at this point?
* I'm not sure offhand how costly the implementation would be (I'm guessing it'd be pretty non-trivial)
* I'd like to brainstorm up some potential use cases to convince me it'd be worthwhile =)

As an appetizer, I've seen Scheme turned into a logic programming language (along the lines of Prolog) by a few crafty professors/instructors (Dan Friedman, Will Byrd, Oleg Kiselyov) with a clever but comparatively small set of Scheme macros. http://kanren.sourceforge.net/

Evan D.