2 ms·
I'm not all that familiar with Lua so happy to be corrected here, but from what I know it's really small, really fast and really simple (to use), which makes me
by bodge5000 3y ago
I'm not all that familiar with Lua so happy to be corrected here, but from what I know it's really small, really fast and really simple (to use), which makes me wonder why it's not used more often. Like I get it's not gonna be as fast as C, but apparently it's about as fast as C++. And it's not as simple as Python, but from what I've seen it's not far off. What's the catch?
- toastal 3y agoLack of types hurts. Then there's the 1-base indexing that bothers many. The whole "tables" concept is kinda weird—and this makes more complex kinds of programming difficult/unergonomic. Luckily like JavaScript, there are a wealth of languages that compile to Lua to smooth over missing language features. One outlier feature is that Lua supports tail call optimization.
- jshmrsn 3y agoThere’s a lot of surface area to cover. In my opinion, the main thing that holds Lua back from wider adoption is the thing that makes it useful for its niche case. That is, the runtime and standard library are extremely small, making it easy and lightweight to embed in programs across a variety of platforms. However, that minimalist runtime and standard library also mean that it’s hard to deliver Lua libraries and frameworks without requiring native code extensions (e.g. any kind of networking and serious file system interactions) would require platform-specific extensions. Additionally, because Lua is so simple (for example there is no built-in concept of classes), the way to write code in Lua is quite open-ended. Many Lua users use their own or one of many prebuilt class systems. Using code from someone’s library might mean pulling in its custom class system and interacting with it as well. Custom class systems can be somewhat magical and involve metatable and suddenly things aren’t very simple anymore. Lua is also just a bit odd to use with one based indices, tables being kinda-sorta arrays if you use them in just the right way, needing to use pairs vs. ipairs in loops, variables being global by default if you forget to type “local” (unless you use Lua strict, and also all the libraries you want to use are compatible).
- diego_moita 3y ago> What's the catch? It doesn't have big sponsors. Java had Sun and Google. Python, Kotlyn and Go have Google. C had AT&T. Basic and C# had Microsoft. Objective-C and Swift had Apple. FORTRAN and Cobol had IBM. Javascript and Rust had Mozilla, ... Lua has a lot of small sponsors but no big one. Very few languages succeed just on their merits, without big sponsors.