Oddbean new post about | logout
 Oh! I'm curious to hear more of your thoughts on Lua.

I'm now considering embedding a sandboxed, IO-less, computation-budgeted scripting language, and Lua crossed my mind, since it was motivated by embedding. But... I don't actually have any experience with it. 
 I'm not sure Lua fits those requirements. You can probably restrict or remove its I/O abilities, but I don't think it's designed to be computation-budgeted (if I understand what that's supposed to mean). Lua uses a byte-code virtual machine with a very clean, simple C ABI interface (and C library bindings to go with it). Indeed, I would be so bold as to equate Lua to "C script": it's small, simple, and powerful. C focuses on global/static variables, functions, and arrays. Lua focuses on global variables, functions, and tables (Lua tables are really key-value maps). Lua seems to answer the question "what if we turned C into a scripting language that could be re-executed at runtime without recompiling to machine code?" And for that purpose, Lua is great. My gripes with Lua stem from its simplicity and lack of safeguards around certain patterns, very similar to C. For embedded systems, I don't think Lua is a good idea; for games and other "non-critical" software that needs to support quick development and iteration of code and ideas, it's a very solid choice.