Language idealist, lover of elegance and simplicity.
Challenge: Design and implement a tiny language that has it all. Oh, perhaps that's a bit hard for a casual challenge!
A bit of history: I first came across Lua because of my interest in virtual machines, and discarded it at once because its VM is language-specific. Not Lua's fault at all. Then I remembered it when I was doing some scripting and cursing Perl for the umpteenth time (I'm not a wizard; I simply can't remember all that magic!) and discovered what a lovely language it is. For I while I did most of my scripting in Lua; now I use Python, for its much richer set of standard libraries. I have used Lua for portable programming: I rewrote [GNU Zile] in Lua, and advocate its use for POSIX programming.
- Programming: I love the way you can do functional and object-oriented programming in Lua. This is reflected in my contributions to SampleCode. I used Lua for application development at Protechnic Exeter (now defunct) where I wrote a thin OO Lua layer (1.5 kLOC) over a vast (~1 MLOC) and ancient C application, but my biggest Lua project was rewriting GNU Zile in Lua (~6 kLOC, and falling!).
- Libraries: I started the [stdlib] project, which provides basic data structures and algorithms in pure Lua. I implemented the now-defunct bitwise operations library bitlib (superceded by Mike Pall's [BitOp], and later by Lua's own bitwise operators) and the widely-used regex library binding [lrexlib] (now maintained by Shmuel Zeigerman, and supporting PCRE, POSIX, TRE, GNU and Oniguruma regex libraries). I also maintain and contribute to a wide range of C bindings including [lcurses], [luaposix], as well as [lua-mode] (a Lua editing mode for Emacs), and the minimal Lua-C binding [clue].
- Patches: I maintain a number of mostly small and backwards-compatible LuaPowerPatches. I once had a go at making a stable table.sort function: I made a merge sort, but would rather make a stable quicksort.
- Language: I've been all mouth (see LocalByDefault) and no trousers on this front. Edgar Toernig's Sol ("Son of Lua"; seems to be defunct) was interesting; also to my taste is Lua-in-Lua, as implemented by [Yueliang].
- Porting: I maintained an [EPOC port] (currently at 5.1.4), which comes as a DLL, with an OPX, so it can be used from C/C++ and OPL, and did some work on a UIQ version for Symbian, which didn't come to much owing to their lack of support for OPL. I used to maintain a Linux RPM (tailored to Fedora), now maintained by Andre Costa, and I did an early RISC OS port, but deferred to the more energetic and capable GavinWraith.
- Thanks for the sample code, some very good material. getopt is a beast and a half! :-) --NickTrout
- I agree! Any lua code I can get a look at is great, but this is phenomenal. --JamesHearn
- I agree that Perl is a horror. I assume you must have come across Python? I just wondered why you chose Lua over Python, especially for system/parsing scripts. -- You have experience with functional languages, I do not. Which is a good one to learn to get a feel for them? Perhaps there should be a HowLuaComparesWithOtherLanguages? page? Sometimes its nice to see a comparison of features. It also drives people to try and implement the features in Lua. Erm, I'm suggesting that here because I think you're far more qualified to start a page like that if you felt like it ;-) --NickTrout
- I finally got around to learning some Python in 2010, and kicked myself for not having done so years ago (I clearly remember standing in a bookshop in about 2000 with a copy of the Python book in my hands, and after several minutes of consideration I put it back on the shelf...). OCaml  is probably the best functional language to learn to get a feel, as it combines a rich language with an excellent compiler. Haskell  is more purely functional, with lazy evaluation and proper functional I/O, but it'll take a bit longer to get your head around. --ReubenThomas
- Python is a good language to learn. It's easy to learn (I should think it'll take you about an afternoon), and supports many programming styles, including functional programming. Sadly its lambdas are restricted in syntax and variable access (remember read-only upvalues?). The libraries of Python are big, but the language itself is fairly small. It has enough novel features to make it worth while for the collector of languages. --DavidJones
RecentChanges · preferences
edit · history
Last edited July 11, 2020 11:00 pm GMT (diff)