Originally Posted by
joeavaerage
Hi,
Initially I was tempted to agree but have come to realise Lua has certain advantages that many other supposedly better languages lack.
Smurph, one of the leading developers of Mach4 has said that 'Lua has a syntax that only a mother could love'. So even Smurph regards
the language as somewhat syntactically challenging....but...it has some distinct advantages:
Firstly Lua is fast, very fast, for a scripting language, an order of magnitude faster than Python say.
Secondly Lua is very lightweight, ie the C code that IS Lua is very small indeed, something like one tenth the code burden of Javascript for instance.
A classic example of this is the string manipulation functions. In Javascript the string functions are fully POSIX compliant and require about 5M of code.
Lua string functions on the other hand appear somewhat limited but can in fact execute all POSIX string functions but requires less than 100k of code.
Lua can be written to accommodate a number of different paradigms, I mostly use straight out procedural code, but Lua can be pushed into object and functional
oriented code. Once you get your head around the table structure and you realise how easy it is to code a state machine for example you'll come to appreciate
that what looks to be so simple and lightweight can yet be SO flexible.
I suppose the other point is that Mach4 is a CNC software solution. Lua was chosen to add the scripting ability so that users could customise Mach4 to their needs,
but is still only a CNC solution. Its not a software development environment....if you want to develop software then of course there are better choices than Lua....but Lua
is NOT for developing software but rather for adding a fast, lightweight, flexible scripting language to add to Machs code base. Lua does that well.
Craig