Oddbean new post about | logout
 I've been learning the Defold game engine (and teaching it as I go) and I have
to say that I mostly like it. Godot gets most of the "small game engine"
attention, but Defold seems to be a very worthy competitor. I really like the
built-in messaging system and it provides a TON of flexibility while presenting
a simple concept. My biggest issues with it so far are poor drag-and-drop
support for the editor, and overall the bare-bones nature of the editor in
general. The Lua code completion in the editor is really good, but Lua is a bit
of an opaque language and finding the correct API to use and teaching the
concepts has been quite difficult and time-consuming. Defold has a lot of
promise, but I feel like it presents a higher-than-usual learning barrier and
the messaging concepts can lead to some seriously tangled runtime headaches.
Again, I'm still learning Defold, but I expect to use it for some small 2D
projects in the future to compare and contrast it to UE5, Godot, and of course
my own game engine, Clockwork.

#gamedev #indiedev #defold 
 Oh! I'm curious to hear more of your thoughts on Lua.

I'm now considering embedding a sandboxed, IO-less, computation-budgeted scripting language, and Lua crossed my mind, since it was motivated by embedding. But... I don't actually have any experience with it. 
 I'm not sure Lua fits those requirements. You can probably restrict or remove its I/O abilities, but I don't think it's designed to be computation-budgeted (if I understand what that's supposed to mean). Lua uses a byte-code virtual machine with a very clean, simple C ABI interface (and C library bindings to go with it). Indeed, I would be so bold as to equate Lua to "C script": it's small, simple, and powerful. C focuses on global/static variables, functions, and arrays. Lua focuses on global variables, functions, and tables (Lua tables are really key-value maps). Lua seems to answer the question "what if we turned C into a scripting language that could be re-executed at runtime without recompiling to machine code?" And for that purpose, Lua is great. My gripes with Lua stem from its simplicity and lack of safeguards around certain patterns, very similar to C. For embedded systems, I don't think Lua is a good idea; for games and other "non-critical" software that needs to support quick development and iteration of code and ideas, it's a very solid choice.