top | item 43726723

(no title)

landsman | 10 months ago

Scripting in Lua sounds good.

discuss

order

jbverschoor|10 months ago

For small scripts. Lua is a huge minefield

noodletheworld|10 months ago

That seems kind of unfair.

There are things that aren't great about lua, and I'm not going to pretend they're not. buuuut...

- It's really perfectly ok if you use competently.

- There are large complex systems and games built using it (eg. factorio) that show that scaling it is both pragmatic and possible.

- It has a big active community.

When you compare it some other scripting solutions (boo, unityscript) that were just incompetently done, or mystifyingly deciding that writing your own language is the solution (jai, gdscript), I feel you have to admit it's a reasonably pragmatic choice.

There aren't a lot of other languages that embed as a scripting layer the same way that lua does, with the same performance.

Many candidates are either very hard to work with embedded (python) or simply lack any feasible way to possible embed them as a runtime scripting layer (go, zig, c, etc).

Maybe there's a future for WASM scripting layers in games, but for now, I certainly haven't seen it done well.

I can confidently say: Lua, the language, is not a minefield. Not to me. Not to you. Not to anyone.

Some projects expose a lua scripting API that is a minefield; ...but those two things are not the same thing, and by all accounts (I haven't used it personally, but just idly reading the forums) the defold scripting layer seems fine to most people.