- comments start with --
- no bitwise operations in language
- default numeric data type is floating-point. it's possible to change it to
integer but it raises uncertainty with compatibility of external libraries
- OOP in lua is quite programmer-specific: everyone seems to have their own
best practises
Of course lua has good features too, like coroutines and good C API. Squirrel (http://squirrel-lang.org/) also seems like a nicer alternative to lua but it requires a C++ compiler.
IMHO lua's best asset is the small and fast VM. I wish there would be other good, modern languages that target it.
for bitwise ops: look at 5.2, it has it now. 32-bit operations.
floating point arithmetic: in practice, I haven't seen it as a problem as soon as I stay within the 32-bit range - then the numbers can be represented exactly, so the abstraction works well.
OOP: can't say for it, I did not do it much.
For the "fast" - check luajit (http://luajit.org/) - it is near-native speed while remaining reasonably slow.
The annoyance that I'd thought of is that the array indexing starts with one, not zero - this brings some headaches during the index calculations. But this also forces to rethink the logic to use more of iterators, and abstract away from the indices. So, after all, it is not that big of a deal.
Oh on arm you will definitely will want to check out luajit precisely for the number performance - see this comment for details : http://news.ycombinator.com/item?id=2617835 - luajit will use integers where it can.
I did not experiment with this myself though, but hopefully it might ease your woes with no FPU - http://luajit.org/performance_arm.html shows 85x speedup for md5, which I suppose would be integer algorithm.
Out of curiosity, what is the platform, if not a secret ?
-- Comment syntax is that a big deal?
- bit wise: LuaJIT?
- Just like in Python and Javascript, what's the issue?
Doubles do just fine as integers if you code so that
you always wind up with other integers.
- OOP - This I agree is a community fragmentation issue.
One issue is that it's easy to end up with things that aren't round numbers by mistake (if you do any sort of division, for example, or are getting results from an external library, etc., and strategies for reducing errors that rely on the programmer not screwing up are generally doomed to failure.) That has several problems: floats are imprecise, you introduce the potential for additional runtime errors if you're doing something like indexing into an array, etc.
Also, Python has separate integer and floating-point operations:
The GP mentioned arbitrary precision integers, which Python has. I believe they're called Long, and integers that overflow are cast to Long (represented as 123L).
Agree strongly about the floating point being a problem. I much prefer languages like Erlang, Python, and Ruby where the default numeric type is arbitrary precision integers.
I see, thank you. None of this sounds like a show-stopper to me, but it's good to have a more complete view of a language I'm not intimately familiar with.
Yes, none are show stoppers. Lua suits perfectly for for the use it was designed: small embeddable scripting. I hope no one is writing millions of lines of lua code! For me even small amount just does not "feel right" the way for example ruby does. That's why I've been eagerly waiting for mruby but unfortunately it does not (yet) fill the void.
IMHO lua's best asset is the small and fast VM. I wish there would be other good, modern languages that target it.