News for hackers. Stuff that matters.
Re:Learn Lua in 15 Minutes by outworlder on Monday June 24, 2013 @05:22PM (#5935764)
This is awesome.

On that note, I don't understand all the javascript craze. Lua has been around for quite some time, and it's small, with well-defined semantics, a nice set of features, the interpreter is small and very fast, you can get even faster with LuaJIT, etc. Browsers should have adopted that ages ago.

Re:Learn Lua in 15 Minutes by fhd2 on Monday June 24, 2013 @05:33PM (#5935830)
Yeah, I see Lua in many ways as "JavaScript done right".

I also found it considerably easier to integrate than something like V8, and it appears to be easier to use for non-programmers.

It definitely deserves to be more popular.

Re:Learn Lua in 15 Minutes by taproot on Monday June 24, 2013 @07:23PM (#5936406)
Javascript being used by non programmers is 95% of the problems with javascript.. care to explain your problems with js and maybe expand on how lua is done right?
Re:Learn Lua in 15 Minutes by ufo on Monday June 24, 2013 @11:10PM (#5937290)
Lua is a much smaller language and overall it is much more consistent and has less corner cases than Javascript since the language had the opportunity to evolve over the years instead of needing to retain backwards compatibility with browsers from 1995. For example:

* Lua has proper lexical scoping instead of the confusing "function scoping" of Javascript (so there is no need to use the IIFEs hack).

* Lua has a Python-style lexicaly scoped self instead of the error prone dynamically scoped "this". No need to use `var taht = this` if you have nested functions.

* The metatable system is much more flexible than the simple JS prototypal inheritance system (you can sort of implement "method missing" instead of being forced to only delegate to a concrete table.

* You can use anything as a Lua table key. In JS all keys are converted to strigns. Lua also supports weak references.

* Coroutines! Its sort of like ES6 generators and is super awesome. Async programming is infinitely more pleasant in Lua than it currently is in JS because you don't need to convert code to continuation passing style.

Re:Learn Lua in 15 Minutes by fhd2 on Tuesday June 25, 2013 @12:08AM (#5937456)
> Javascript being used by non programmers is 95% of the problems with javascript..

Well, I wasn't advocating Lua as a good language for non-programmers to write programs, but for scripting. When I make games/applications scriptable, it's closer to configurating than programming, and Lua's table constructors allow for great declarative DSLs.

Re:Learn Lua in 15 Minutes by saraid216 on Monday June 24, 2013 @05:47PM (#5935924)
> On that note, I don't understand all the javascript craze. ... Browsers should have adopted that ages ago.

Someone still has to actually do the work. Then it has to get adoption. No one has bothered to do either.

Re:Learn Lua in 15 Minutes by stevekemp on Tuesday June 25, 2013 @01:35AM (#5937731)
My new email client is heavily scriptable via Lua:

http://lumail.org/examples/

Re:Learn Lua in 15 Minutes by seabee on Monday June 24, 2013 @05:53PM (#5935968)
Because it indexes from 1 and doesn't use braces? (semi-sarcastic)
Re:Learn Lua in 15 Minutes by aualin on Monday June 24, 2013 @06:54PM (#5936271)
I remember Pascal being fairly popular, and it does both. (Except if you count comments, but i assume that was not what you meant.)

EDIT: Also Fortran.

Re:Learn Lua in 15 Minutes by dagurp on Monday June 24, 2013 @06:57PM (#5936284)
Maybe when it supports unicode
Re:Learn Lua in 15 Minutes by jacques_chester on Monday June 24, 2013 @10:54PM (#5937242)
Unicode is not included because currently they target ANSI C. Pure ANSI C.

Not POSIX.

Plain old C.

Until C11, unicode didn't exist in C. And it will be a long time before C11 is the default. Hell, there's lots of places where C99 is the exotic interloper.

Re:Learn Lua in 15 Minutes by anonymoushn on Monday June 24, 2013 @07:04PM (#5936321)
What do you want to do that you cannot do because of the lack of Unicode support?
Re:Learn Lua in 15 Minutes by DrewAllyn on Monday June 24, 2013 @07:56PM (#5936556)
I'd imagine internationalized gamed would be a big one, although I'm not a games programmer or a lua user myself.
Re:Learn Lua in 15 Minutes by anonymoushn on Tuesday June 25, 2013 @08:38AM (#5938973)
I had hoped that someone would mention what specific thing was missing, because as far as I know it's trivial to do anything one would want to do when making games already. That is, it is very easy to accept UTF-8 input, output UTF-8, munge UTF-8 strings together prior to outputting them, compare UTF-8 strings for equality, and so on. If the game needs UTF-8-aware strlen (for limiting the length of a field or alphabetizing things), it is like 10 lines of code.
Re:Learn Lua in 15 Minutes by Tloewald on Monday June 24, 2013 @08:52PM (#5936781)
World of Warcraft seems to struggle on (its UI is built of Lua)