5 ms·
What are the ideas that Lua follows that are different from everything else? I'm not sure it's the language I'm looking for, but I will keep it in mind if I eve
by SlySherZ 10y ago
What are the ideas that Lua follows that are different from everything else? I'm not sure it's the language I'm looking for, but I will keep it in mind if I ever need something like it. Thanks!
- sheepmullet 10y agoIncredibly straight forward sand-boxing and embedding.
- Qwertystop 10y agoMinimalism, DSLs, and embeddability. It's got a very good API for binding with C, and is small enough to reasonably be included whole in any project if you don't want to have external dependencies. It's also extremely modifiable due to the minimalism - it's got a few primitive types, basic control-flow, and one structured type, the table (a key-value store) which is used for everything else from lists (integer keys, sugar exists for this) to sets (values as keys, "true" for values) to classes. Dotted attribute access is just sugar on string-key access, so methods are just functions with a "self" parameter (there's sugar to hide that) that you put in the table. Default-values and operator overloading - just specific keys mapping to appropriately-defined functions. I haven't looked much at JavaScript but I think it's a bit like JS's prototypes? Again, though - unless you need it tiny, you probably want Penlight or something like it to provide all the utilities that weren't quite basic enough to be core. In that case, you've got a good chunk of, effectively, the Python core libraries to work with.