← Back to context

Comment by corysama

17 hours ago

In my use cases, I’ve appreciated how easy it is to cut out most of Lua’s standard library and run only the bare language.

As a game engine guy, I’ve been setting up Lua to be used by semi-technical game designers. I know I’m going to have to help them debug some crazy script months from now, so I want to carefully prescribe the APIs they get to play with from the beginning. Ex: No raw file system access! Only load assets through the asset system.

Lua shines when it is embedded in a larger program, giving high-level commands. There have been plenty of projects trying to build full applications in Lua. But, that’s really fighting against its design.

Yeah, they definitely won on the embed side. Ruby was also designed for this use case, though I can't think of too many examples, which may hint that the small size and footprint of Lua was important. (There's RGSS in RPG Maker XP.)

Lua on the other hand is all over the place. Wireshark dissectors, OpenResty, game engines, and tons more.

That said, it seems like almost everyone is still embedding Lua 5.1 or forks of it like LuaJIT, and I think a lot of game engine people want slightly different things out of Lua than what it offers, hence offshoots like Luau, GameMonkey script, and Squirrel lang. Maybe it's good that Lua doesn't try to be all things to all people, since it has broad applicability, but it does feel, at least to me, like things could be better. For example, at least having a syntax for types that could be checked externally, like Python. The core shouldn't be bloated up with a module system and package manager, but a CLI tool with that functionality certainly would be nice, could probably be written in Lua. And I do understand why people don't want an all-encompassing standard library, but not having bitwise operators in the language or standard library can be a bit of a drag. That's just my thoughts on the matter, anyway.