4 ms·
I'm curious, why did you chose Lua?
by shin_lao 15y ago
I'm curious, why did you chose Lua?
- antirez 15y ago1) 'make ansi' 2) Very fast for a such a small implementation. 3) C - Lua API makes sense. 4) Any algol-like language is easily picked by a programmer. So Lisp or Tcl could not be idea, but Lua is fine syntax wise. What I don't like about Lua (but was not enough to stop me from using it for Redis): 1) 1-based indexes. 2) ~=, why not != that everybody knows? 3) A unique "float" type for all the numbers is not ideal. 4) A unique "table" type for maps and arrays is not ideal. 5) You want to be small, but C bit operations as native operators inside the core are a good idea.
- shin_lao 15y agoWhat about Javascript? Did you consider using V8 instead of Lua?
- antirez 15y agoIn order to write the kind of programs you write to script Redis, Lua or Javascript are substantially equivalent, but V8 is a huge implementation, less portable, and so forth. This is why I avoided it.
- julian37 15y agoYou want to be small, but C bit operations as native operators inside the core are a good idea. Not being a Lua user, it took me a little while to parse that. You're right, implementing these as library functions is silly, and having a dozen implementations to pick from is ludicrous! http://lua-users.org/wiki/BitwiseOperators http://lua-users.org/wiki/BitwiseOperators EDIT: Ok, less ludicrous now that they're shipping the "bit32" implementation.