by nine_k · 1y ago · 0 comments
Surprisingly, LuaJIT is not mentioned even once. Luau is mentioned, Teal is mentioned, Fennel, not. (But Haskell is mentioned!)
Little is told about the general code structure, likely because it's dictated by the (C++-based) game engine with Lua bindings. It would be interesting to see an analysis of a comparably large game built with Löve, for instance.
Viewing a list of folders? Lua. Viewing a list of messages? lua. Viewing a single message? Lua. Those were the three main modes and UI options.
All the keybindings, layout, colour setup, and similar was dynamic. It actually worked out really well. For comparison I just ran "wc -l" against he codebase: 60k lines. Combination of C++ and Lua, but mostly Lua.
Having good scope and good tests made such a thing fine to support. Mostly the pain was broken MIME messages and handling dealing with the external world - e.g. invoking gpg to handle decryption and encryption.
I'd work with big-lua again if I had the need, it's a fun language and very flexible.
It is possible to make it not crumble under its own weight, right? I had my share of Lua nightmare with more than 100K lines of code back when I was a gamedev [1], and it seems that there are some requirements in order to remain sane with the growth. Thankfully there are now multiple working type checkers for Lua, unlike when I had to built my own.
[1] https://news.ycombinator.com/item?id=18351788 is my canonical answer, but I have written many other comments about Lua which should be easy to search.
The main reason I like static languages and other such things is that after many decades of the programming community developing, since before I was born, we have not found very many best ways of "bringing enough discipline" to a codebase. It really all amounts to the same disciplines over and over. Check the types. Be sure guarantees are maintained. Document the input and output parameters. If there were dozens of very distinct and mutually-contradictory ways to impose this discipline, and there was no clear domination among those ways, then it might make sense for all of our languages to be loosey-goosey and not impose anything directly. But since we all generally find the same disciplines, we might as well pull those up to the language level and thereby enable them to be fully supported, and share the tooling among each other rather than expecting every junior dev to reinvent it from scratch... which they won't.
Defold uses LuaJIT (except for web which I think uses Lua 5.1 compiled to wasm?), so it's taken for granted.