lua-users home
lua-l archive

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


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Paul Hudson wrote:
[...]
> Because, for Lua in particular, there is a resistance to convenience and
> sugar. Not a refusal to ever consider it, but Lua is remarkably free of
> cruft and I for one would prefer it stayed that way.

Yup. There are, AFAIK, precisely two bits of syntactic sugar in Lua ---
: notation for calling functions, and 'local function' for defining
them. And even the first isn't really sugar, as it generates specific
bytecode that you can't generate elsewhere.

I'm like you in that I don't think Lua should get these syntax
extensions. I want it small and simple and with only one way of doing
anything. It is entirely feasible, and indeed quite easy, to write your
own language translator into Lua and bolt it into the require system
(I'm doing that for Objective Lua (release Real Soon Now!) and it works
very well).

So if people want functional syntax, design a *proper* functional
language syntax from the ground up and translate it into Lua. That way
you get other functional things like everything-is-an-expression, etc.
Most functional languages have simple syntaxes that are easy to parse, too.

(Although this isn't a democracy, and the language devs have the only
opinion that matters, and quite rightly ignore all the periodic
discussione of 'I-want-$FEATURE'... I will say that I'd be very happy if
they could consider adding #line support. Right now generating Lua is a
pain because in order to get the debug information right we have to do
it all in order. That is, the generated code for line 7 of the source
file must exist on line 7 of the output Lua file, and woe betide you if
you want to generate the code for line 8 of the source file on line 6 of
the output file. It's annoyingly restrictive, particular when you need
to clump related bits of code together to take advantage of the lexical
scoping.)

- --
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│
│ "Sufficiently advanced incompetence is indistinguishable from
│ malice." -- Vernon Schryver
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAksY+/8ACgkQf9E0noFvlzjQ2ACfdSBmw799DNrdZxvnOI2eHuDq
c0QAmwbUi1BQHr4wwOVoVQUWY9sk5syp
=IzNK
-----END PGP SIGNATURE-----