News for hackers. Stuff that matters.
Re:JLua: Yet another Lua implementation in JavaScript by gadgetoid on Saturday May 25, 2019 @01:08AM (#20007221)
I’ve recently compiled a Lua-based project into WASM with Emscripten, but transpiling Lua into JS to avoid the engine overhead is compelling. I wonder how these approaches compare. For me it’s very alluring to use most of the same codebase as other deployment targets. This also has the potential to add better contextual intelligence to a web-based Lua editor- I’ll have to race it against Regex to see which is faster/better at pulling lists of locals/globals/functions out of Lua input for use in auto-complete.
Re:JLua: Yet another Lua implementation in JavaScript by vvanders on Saturday May 25, 2019 @01:15AM (#20007247)
Honestly I'd love to go the other way, the Lua VMs are so far ahead in terms of portability, ease of integration and speed(luajit is still a marvel of engineering) but so many people are turned off by parts of the language it'd be great to present a JS interface to these runtimes.

I still remember shipping the entire game logic for a title on the PSP inside of a 400kb block and that's was before the days of luajit. It's really an incredible language and I really wish it saw more mainstream use.

Re:JLua: Yet another Lua implementation in JavaScript by gadgetoid on Saturday May 25, 2019 @01:59AM (#20007363)
Me too! I think it’s gaining a little extra appreciation lately. For us the wow-factor was the ease of tying it together with a C host program in lieu of some conf file based alternative. For example our Keybow (Raspberry Pi-powered mechanical macro keyboard) product uses Lua to let users easily define and share macros. Not only does this trivially exceed any effort I could have made to design a domain-specific configuration file format, but it’s allowed users to try things I’d never conceived.
Re:JLua: Yet another Lua implementation in JavaScript by orbifold on Saturday May 25, 2019 @11:13AM (#20009480)
This is what it was initially designed for.
Re:JLua: Yet another Lua implementation in JavaScript by danbolt on Saturday May 25, 2019 @02:41PM (#20010522)
That’s super cool. Lua’s footprint has always been enticing to me because of that. Which game did you work on?
Re:JLua: Yet another Lua implementation in JavaScript by blondin on Saturday May 25, 2019 @11:04AM (#20009431)
that's some beautiful javascript code and great project structure here. got me thinking about a few things: 1. is the "index.js" in subfolders a nodejs thing? 2. does that turn subfolders into modules? 3. can you write and run that kind of javascript without nodejs?
Re:JLua: Yet another Lua implementation in JavaScript by ianjsikes on Saturday May 25, 2019 @03:14PM (#20010702)
1. The "index.js" thing is due to how module resolution is handled with CommonJS and ES modules. If you have a file at "./lib/index.js", then you can omit the "index.js" and just write "require('./lib')" from another file.

2. Not exactly. In JS, every file with an "import" or "export" statement somewhere is its own module.

3. You can write code like this for the browser. Most browsers support ES modules now. However, you do need a bundler tool like Webpack if your code depends on other node modules.

Re:JLua: Yet another Lua implementation in JavaScript by hyperpallium on Saturday May 25, 2019 @06:17AM (#20008147)
\tangent Time was, a J prefix initialized Java.
Re:JLua: Yet another Lua implementation in JavaScript by ufo on Saturday May 25, 2019 @01:08AM (#20007219)
The description of the project begs the question: how is this different from other Javascript implementations of Lua?
Re:JLua: Yet another Lua implementation in JavaScript by luadigest on Saturday May 25, 2019 @04:32AM (#20007769)
@op I run the newsletter Lua Digest, what's your email?
Re:JLua: Yet another Lua implementation in JavaScript by saagarjha on Saturday May 25, 2019 @06:08AM (#20008113)
The GitHub profile of the user has an email.
Re:JLua: Yet another Lua implementation in JavaScript by mconintet on Sunday May 26, 2019 @03:16AM (#20013582)
hi, this one: [email protected]
Re:JLua: Yet another Lua implementation in JavaScript by rs23296008n1 on Sunday May 26, 2019 @03:08AM (#20013570)
I would name this project yajslua instead of jlua.
Re:JLua: Yet another Lua implementation in JavaScript by Uptrenda on Saturday May 25, 2019 @06:03AM (#20008084)
Why do people put time and effort into a project and then name it as if its a generic, disposable, piece of garbage? Very strange
Re:JLua: Yet another Lua implementation in JavaScript by MaxBarraclough on Saturday May 25, 2019 @06:21AM (#20008156)
I have a different objection: the 'J' prefix is standard for projects in Java, not JavaScript. 'JSLua' would have been better.

Turns out there's already a Lua-in-Java project that goes by LuaJ: https://github.com/luaj/luaj

Re:JLua: Yet another Lua implementation in JavaScript by saagarjha on Saturday May 25, 2019 @06:06AM (#20008102)
It's a tradition, apparently: https://en.wikipedia.org/wiki/Yet_another
Re:JLua: Yet another Lua implementation in JavaScript by Uptrenda on Saturday May 25, 2019 @06:13AM (#20008131)
Interesting, I didn't know Yahoo! was based on this. +1
Re:JLua: Yet another Lua implementation in JavaScript by imtringued on Saturday May 25, 2019 @06:30AM (#20008188)
The problem with the name is that it's almost identical to the Java implementation of Lua which is called LuaJ.
Re:JLua: Yet another Lua implementation in JavaScript by mconintet on Sunday May 26, 2019 @03:03AM (#20013550)
I have no idea, maybe those people are unaware of others will turn a blind eye to what are in the project but complain a lot about the project name. Weird.
Re:JLua: Yet another Lua implementation in JavaScript by ourlordcaffeine on Saturday May 25, 2019 @06:14AM (#20008136)
I'm really not interested in "Lua now implemented in x", what Lua needs is the new Luajit finished with the advanced garbage collection.
Re:JLua: Yet another Lua implementation in JavaScript by rs23296008n1 on Sunday May 26, 2019 @03:06AM (#20013559)
Everyone scratches their own itch. There is value in multiple implementations when they explore different approaches. This just means either a "perfect answer" has not been found or that the journey itself is seen as worthwhile.
Re:JLua: Yet another Lua implementation in JavaScript by jquery_dev on Saturday May 25, 2019 @08:09AM (#20008542)
Why take the time to comment then?
Re:JLua: Yet another Lua implementation in JavaScript by vinay427 on Saturday May 25, 2019 @10:15AM (#20009178)
To be fair, they did at least mention an alternative direction to pursue, so it's probably more useful than many of the dismissive comments that I see. I'm not convinced every comment on a project needs to be supportive of the project and its goals.