4 ms·
I'm happy with anything that gives Lua more exposure. It's a pretty language and it is so damn small, fast and embeddable. Too many developers are using Javasc
by scrollaway 11y ago
I'm happy with anything that gives Lua more exposure. It's a pretty language and it is so damn small, fast and embeddable.
Too many developers are using Javascript in places where Lua would be a far more appropriate option. Embedding, especially.
- nly 11y agoWhy is embedding Javascript inappropriate? Duktape has a similar codesize to Lua 5.3 http://duktape.org/index.html http://duktape.org/index.html
- aleksi 11y agoIn my opinion, Lua is better-designed language. JavaScript has horrible parts.
- patates 11y agoI've been developing game scripts with Lua and I've professional Javascript experience so I'm familiar with both. I actually find Javascript way more readable and easier to work with in general, especially with the new additions. I mean, it's yet another anecdote but just wanted to share.
- luchadorvader 11y agoWhy do you say Lua is better designed? And are you comparing classic JS or ES6 JS? I like Lua but there are some things that just annoy me like indexing an array with 1, smaller standard library, etc. I find JS implementation of inheritance, objects, and prototyping better than Lua due to its simplicity.
- ludamad 11y ago1. Indexing an array with 1 is unfortunate but not a bad design decision in a vacuum, eg for i=1,#size is a very easy to understand loop over valid array indexes. I'll agree that it causes cognitive load in practice. 2. JS has a somewhat broken notion of objects and Lua's implementation is far cleaner while being as powerful. How do you use a JavaScript object as a hashmap? The default try is a potential security hole.
- sspiff 11y agoI agree. Both JS and Lua have a pretty limited standard library, but Lua is a dead simple language with a few simple mechanics that can be used to achieve complicated concepts. I haven't got major experience in either language, but I find it much easier to read/understand/modify a moderately sized Lua project vs real world JavaScript code.