It might be of interest to some reading this section of the forum to know that there is also a version of Lua available for embedded microcontrollers - eLua
Not to start a flame war, but the Lua people are (in my opinion!) simply reinventing the wheel that FORTH solved a long time ago.
FORTH is self hosting (can be written in itself - bar about two/three words), can be ported to pretty much anything, and can be interactive via a console port on any processor that can execute code out of RAM. In fact, with a little bit of thought you can even do interactive programming on processors that CAN’T execute code out of RAM…
Of course, you have to be comfortable with a stack based language (although anyone who uses a HP RPN calculator should be)…
So isn’t that Lua’s USP, then?
(USP = Unique Selling Point)
Forth is indeed very easy to embed, enjoys a conceptually beautiful minimalism, and has been successfully put in many hardware stuff. However, its stack-based nature is not a minor point in the real life. If you’re an outstanding developer AND you only ever have to deal with code written by fellow outstanding developers, concatenative languages might be a viable option indeed.
If there’s a single “normal” developer contributing, directly or indirectly, now or in the future, any code to your application, your codebase will soon become “write-only”. Your application will become unmaintainable, and any time you might have saved by not doing everything in C will be completely lost.
I love macho programmer jokes as much as any other developer, but I wouldn’t advise anyone to bet his business on them being true.
What Lua brings which Forth doesn’t include:
- a large, useful subset of the language that can be learned in an afternoon by any average C, Java or Python developer;
- some advanced features (coroutines, reified environments, metatables…) which let magicians perform black magic, without complicating the life of regular users.
- a syntax in which its reasonnably easy to write readable code, even by people who don’t fancy themselves as the Chuck Norris of programming.
Besides, if you really want to embed a macho language, Lisp dialects are better candidates than Forth IMO.
Now we just have to wait for them to move out of GPL licencing