4 ms·
> I could get along better with Lua if it was just a little more performant. I really miss things like true consts, macros, inlines, and other basic performance
by wsc981 4y ago
> I could get along better with Lua if it was just a little more performant. I really miss things like true consts, macros, inlines, and other basic performance-focused features. Overall it feels very much like a good scripting extension for a core compiled system and using it to build an entire game, even at the relatively high level I'm working at, is beyond the spec.
Kinda wondering why Lua on the PlayDate seems to have performance issues in his game. Doesn't seem the game does very graphic intensive stuff.
And from my experience LÖVE [0] is quite fast as is LÖVR. I would think Lua should be able to handle much more, but perhaps the animations in the article don't tell the full story.
Perhaps the PlayDate doesn't make use of LuaJIT [1] as LÖVE does? Or perhaps the hardware of the PlayDate itself is just much slower than I would expect.
---
[0]: https://love2d.org https://love2d.org
[1]: https://luajit.org https://luajit.org
- orthoxerox 4y agoIIRC, LÖVE is mainly written in C++ and uses LuaJIT, which has a great bidirectional FFI interface on top of being a tracing JIT compiler.
- jmiskovic 4y agoYes, PlayDate uses Lua 5.4, for a good reason - it is a retro console with a ARM Cortex M7 running at 168 MHz. This is similar to RPi Pico or ESP32 and LuaJIT cannot run on it. In such environment you'd best utilize Lua for configuration, implementing branching dialogs, scripting the story events and similar occasionally-triggered high level code that needs frequent tweaking. A more static project (turn-based, or a card game) could be done just in Lua. Using interpreted Lua in hot loops will not only drag the frame rate, it will also bring down the battery life. Luckily even the plain Lua can easily be integrated with C, so it's not that difficult to take a chunk of Lua-prototyped code and push it down to C. For LuaJIT it's a non-issue for most part (and most algorithms can be reworked to be more efficient while staying in Lua).
- nerdponx 4y agoCan you use Fennel for macros?