![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Lua has been in the back of my head for a while, cannot remember why. Now that I have looked at it a bit by reading this book (and the Lua 5.1 Reference Manual, which is refreshingly short), I seem to be quite fond if it. I had no opportunity to do much with it yet, but there are quite a few things to like.
Functions are first-class values. Functions can be defined as closures. Environments are (kind of) first-class values, too. The syntax is a bit like Modula (while ... do ... end and the like). Typing is dynamic. Variables are created implicitly, which admittedly simplifies a few things, but I don't like it very much. Nothing of these darned $'s and %'s and @'s of Perl, which is good. And not its irregularities of syntax, which is much better. Lua is probably too small for irregularities anyway.
Tables can have metatables that control accesses to existing and particularly to non-existing fields; this is put to some interesting uses. For instance, packages and OOisms are done through tables as well, openly, but with some clever syntactic sugar around it. I like that. Prototype-based inheritance, not real classes, although you can pretend they are there.
Well, yes. Now I should probably go and do the canonical exercise, write a Lisp interpreter in it. Give me the time, someone, please.
Functions are first-class values. Functions can be defined as closures. Environments are (kind of) first-class values, too. The syntax is a bit like Modula (while ... do ... end and the like). Typing is dynamic. Variables are created implicitly, which admittedly simplifies a few things, but I don't like it very much. Nothing of these darned $'s and %'s and @'s of Perl, which is good. And not its irregularities of syntax, which is much better. Lua is probably too small for irregularities anyway.
Tables can have metatables that control accesses to existing and particularly to non-existing fields; this is put to some interesting uses. For instance, packages and OOisms are done through tables as well, openly, but with some clever syntactic sugar around it. I like that. Prototype-based inheritance, not real classes, although you can pretend they are there.
Well, yes. Now I should probably go and do the canonical exercise, write a Lisp interpreter in it. Give me the time, someone, please.