lua-users home
lua-l archive

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


Since I've seen no replies to this suggestion I presume it's been treated
with the contempt it deserves ;-)

In a pathetic attempt to attract attention and drum up a response (even if
it's only a flame), I've come up with an even more ridiculous and grandiose
idea:

Componentise Lua.

I'm trying to achieve two goals here (apart from earning the enduring
opprobrium of this group!):

1. Make Lua's internal mechanisms available in their own right.

2. Enable them to be replaced.

Essentially, this is a matter of designing APIs for Lua's insides.

There's one such component already, ZIOLib, though in the Lua distribution
it's not actually separated out (though you can get it on its own, I
believe). Other part of Lua that would also be very nice to use outside Lua
itself are the hash table package and pattern matcher (a nice lightweight
alternative to full-on regexps). Conversely, one bit of Lua it would be good
to be able to replace is the garbage collector (so, for example, if you're
embedding Lua in a system that already has a garbage collector, you can use
that instead).

Since Lua doesn't look as though it's going to grow into a bigger language
or system (which is, IMO, excellent), it's possible to improve its internal
structure in a way that isn't doable in other systems, and really polish it,
while at the same time making it more flexible (bits can be replaced) and
more useful (rather than just an embeddable language, it's a suite of
ANSI C libraries (a rare beast!), comprising lightweight pattern matching,
heavy duty hash tables, stream IO and garbage collection.

Like my last proposal, I don't think this componentization has any
performance or compatibility penalties: Lua is pretty much built as a series
of components internally in any case. It's just a question of making those
APIs public. Will that tie down future changes? Of course it will, but
that's not a problem, as a) Lua is a maturing language, and b) its designers
have an extraordinary gift for making excellent choices, so I don't think
that (in these areas at least) they'll want to change them radically.

How about it?

-- 
http://sc3d.org/rrt/ | Caution Children At Play Drive Slowly