top | item 24450374

(no title)

kamac | 5 years ago

Why would they create their own obscure solution? I imagine LUA is very easy to run sandboxed, but I can’t shake the feeling roblox would be better off integrating scripting with JS. It would come with powerful typing via typescript, a great tooling (along with a type checker), and a lot of resources available online.

discuss

order

samatman|5 years ago

That's a popular opinion among people who have only used Javascript.

Few who have used both would give it a second thought.

Roblox is immensely popular, has a wide install base and thousands of developers with code in Lua already.

Why throw all of that away for an inferior language?

tasogare|5 years ago

It’s also especially ironic to vouch for Javascript, and then in the next sentence switch to Typescript, which was precisely created to overcome some of JS defects.

lifthrasiir|5 years ago

> That's a popular opinion among people who have only used Javascript. Few who have used both would give it a second thought.

I have extensively used both languages for years and you haven't adequately answered my previous criticism [1].

> Why throw all of that away for an inferior language?

As if Lua (either the language, the implementation or the ecosystem) is not inferior.

> Roblox is immensely popular, has a wide install base and thousands of developers with code in Lua already.

This is probably the only reason to justify Luau, and shows yet another problem with the Lua ecosystem: they don't (or rather, can't) share their creations to each other. JavaScript is not a perfect language but the JS ecosystem has successfully converged into a single widespread set of solutions including TypeScript.

[1] https://news.ycombinator.com/item?id=24067362

wruza|5 years ago

I have a pretty decent experience in lua, js, python, perl and a few in other scripting languages, and personally wouldn't just throw js away in general. Yes, it is a legacy freak, but some latest parts of it are at least worth adopting in other languages. To name a few, constructing objects ({a, ...b, c:[...d, e]}), destructuring, arrow functions conciseness, proxies, default arguments. This helps much in scripting and libraries for scripting. Also I find separate objects and arrays being a better approach than just lua-tables. I like lua, really, but some parts of it... you have to struggle with constantly. Select and "..." sematics in general, meta restrictions, a bloaty syntax.

Imo, the next language with a little stricter typing than both js and lua, which takes best parts of these and gets rid of bad practices, and with a typed version in mind, will be a big win for everyone.

rpastuszak|5 years ago

> Roblox is immensely popular, has a wide install base and thousands of developers with code in Lua already.

100% agree till here:

> Why throw all of that away for an inferior language?

I'd say "not the right tool for the job, given their target audience".

Saying that JS is inferior to Lua (Lua's great IK) isn't much of a productive comment—if they built their audience with JS, they wouldn't be pivoting to Lua because it has achieved superiority in the eternal language wars.

unchar1|5 years ago

I agree that lua is a good fit here, being a smaller and easier language to embed, with a much simpler runtime to boot.

But could you elaborate on why you think JS is an inferior language?

anonymoushn|5 years ago

It's not easy to tell all your players that their games don't work anymore or that they cannot use coroutines. Regarding the second point, more concretely: they no longer can attach a function to a game object that defines its behavior over any length of time, and they no longer can call the sleep() function to suspend execution for a length of time.

kamac|5 years ago

True, there’s some pain involved for the developers. The migration could happen over time, like unity3d did by deprecating scripting with boo.

saagarjha|5 years ago

Lua does exceptionally well as a nice, lightweight language embedded in another project.