lua-users home
lua-l archive

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


On Tuesday 09 August 2005 12:42, Boyko Bantchev wrote:
[...]
> But I was actually serious about the preprocessor I described,
> I do use it and find the style of writing convenient.  Making fun is
> ok, but I was hoping to also provoke some exchange of opinions
> on this.  Can't believe that absolutely noone is interested in such
> a discussion.

I can only speak for myself, but I'm not particularly interested because it 
simply doesn't suit the way I code. While I'm definitely keen on a more 
abbreviated lambda syntax, which you've got, a lot of the other syntactic 
changes look like abbreviations for the sake of it. For example, I simply 
don't see a *need* to abbreviate the coroutine calls to four-character 
mnemonics --- they're not something that are used particularly often, so why 
go to the effort of reducing them to difficult-to-remember mnemonics? IMO, 
clarity trumps conciseness any day. The only reason for going for conciseness 
is when it *aids* clarity by making the algorithm more obvious.

Looking at your substitution list, I would hazard a guess that you're familiar 
with functional languages, and probably APL too. I suspect you might also 
rather like Forth. Am I right?

Another comment is that you seem to be very keen on using single-purpose 
symbols to represent library functions. Unfortunately, this is rather against 
the whole Lua philosophy; math.min *isn't* a language primitive, it's just a 
library function. Presenting it as a primitive is misleading.

(I think what you actually *want* to do is to implement a functional language 
compiler that produces Lua byte-code. I've been the route of the textual 
transform language implementation before, and I'm afraid it fundamentally 
doesn't work.)

I suspect that the main problem with your suggestion is that it's so tightly 
tailored to what *you* want to do that it doesn't actually meet anyone else's 
requirements. (I've been that route, too...)

[...]
> In this respect, could Lua be used as a
> preprocessor to itself?

What you're talking about here is metaprogramming. Lisp has excellent 
metaprogramming support using its rather weird macros; C++ templates are 
another example. (It's possible, using sufficient levels of abuse, to do 
trigonometric calculations purely using the template mechanism. This can be 
handy for producing static lookup tables, but they take ages to compile.) A 
metaprogramming feature for Lua *would* be useful, hence the macro 
preprocessor, but its very high level of dynamicism makes it less of a 
must-have feature than C++'s templates.

-- 
+- David Given --McQ-+ "Feminism encourages women to leave their
|  dg@cowlark.com    | husbands, kill their children, practice withcraft,
| (dg@tao-group.com) | destroy capitalism and become lesbians." --- Rev.
+- www.cowlark.com --+ Pat Robertson

Attachment: pgp0TwYqra0QV.pgp
Description: PGP signature