News for hackers. Stuff that matters.
Re:Source code for Lua 5.3 by sspiff on Wednesday April 06, 2016 @08:51AM (#11438395)
What's the point of posting this? Pointing out how small and elegant a real world language implementation can be?
Re:Source code for Lua 5.3 by scrollaway on Wednesday April 06, 2016 @10:47AM (#11439094)
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.

Re:Source code for Lua 5.3 by nly on Wednesday April 06, 2016 @10:56AM (#11439170)
Why is embedding Javascript inappropriate? Duktape has a similar codesize to Lua 5.3

http://duktape.org/index.html

Re:Source code for Lua 5.3 by aleksi on Wednesday April 06, 2016 @11:06AM (#11439242)
In my opinion, Lua is better-designed language. JavaScript has horrible parts.
Re:Source code for Lua 5.3 by luchadorvader on Wednesday April 06, 2016 @11:57AM (#11439630)
Why 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.
Re:Source code for Lua 5.3 by ludamad on Wednesday April 06, 2016 @04:26PM (#11441772)
1. 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.

Re:Source code for Lua 5.3 by patates on Wednesday April 06, 2016 @11:27AM (#11439386)
I'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.
Re:Source code for Lua 5.3 by sspiff on Wednesday April 06, 2016 @12:02PM (#11439654)
I 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.

Re:Source code for Lua 5.3 by vmorgulis on Wednesday April 06, 2016 @09:09AM (#11438494)
Yes and the design of the source code browsing (by column).
Re:Source code for Lua 5.3 by mrdrozdov on Wednesday April 06, 2016 @09:20AM (#11438551)
What's a "real world language"?
Re:Source code for Lua 5.3 by jessegreathouse on Wednesday April 06, 2016 @09:53AM (#11438751)
A language that gets widespread usage in projects other than academic.
Re:Source code for Lua 5.3 by sspiff on Wednesday April 06, 2016 @10:02AM (#11438819)
Another definition I could see working: a language that is used in projects bigger/more complicated that its own compiler or standard library.
Re:Source code for Lua 5.3 by Narann on Wednesday April 06, 2016 @10:29AM (#11438957)
Hahaha! You got me!
Re:Source code for Lua 5.3 by DonHopkins on Wednesday April 06, 2016 @11:48AM (#11439550)
Lua is widely used and well respected in the game industry (WOW for example [1]), for its efficiency and embeddability.

[1] http://wowwiki.wikia.com/wiki/Lua

Re:Source code for Lua 5.3 by mrdrozdov on Wednesday April 06, 2016 @11:33AM (#11439428)
What's an example of a "not real language" then? I'm feeling a little hard pressed to find an academic language that is not used in industry. I always thought of Lua as academic because I associated it with Torch, but Facebook and Google are both heavy users of Torch, besides Lua has been heavily used in gaming as an embedded scripting language outside of machine learning applications.
Re:Source code for Lua 5.3 by cyphar on Wednesday April 06, 2016 @10:45PM (#11444311)
Neovim is also working on replacing VimL with Lua (by translating VimL to Lua). I think that'll be pretty cool (you will be able to match the emacs people on having all of your configuration in a full programming language).
Re:Source code for Lua 5.3 by llull on Wednesday April 06, 2016 @11:38AM (#11439473)
Idris. Really interesting language exploring dependent types for practical programming, but not yet production ready.