4 ms·
I don't necessarily hate Lua, but I prefer C and Raylib for game dev. Lua is garbage collected, dynamically typed, strays far from standard syntax patterns, and
by onsclom 6mo ago
I don't necessarily hate Lua, but I prefer C and Raylib for game dev. Lua is garbage collected, dynamically typed, strays far from standard syntax patterns, and has less existing tooling than C.
I see why people might hate Lua. Especially for game dev!
- krapp 6mo agoLua is extremely popular for game dev though?
- andersmurphy 6mo agoLuajit is often faster than C. The qualities you described above actually make it great for game dev.
- WhereIsTheTruth 6mo agoA JIT is a double edged sword, it _can_ make your code faster, i remember in the early days of smartphone gaming, developers often had to manually "warm up" the JIT to prevent stutters during gameplay It still is an issue nowadays https://discussions.unity.com/t/app-needs-warmup-first-slow-then-smooth/752242 https://discussions.unity.com/t/app-needs-warmup-first-slow-... Similar story with the GC, it's nice to have, until it causes you problems (wich it will), so you end up having to avoid using it and instead rely on manual techniques JIT and GC aren't the panacea people make them out to be
- andersmurphy 6mo agoTrue using a JIT without understanding it is not a panacea. Same as a GC. Same as malloc and free (you're often much better off with arena allocators). Most JITs let you tune when and how they inline. It's also worth knowing how they works and what they can/can't inline. You linked to monojit. Luajit is a whole other beast. I'd argue it's superior to anything in JS/JAVA/C# land (and I say that as someone with a reasonable understanding of the JVMs C2 JIT). As an aside with low latency GCs like the JVM's ZGC trading manual memory management for no memory related security vulnerabilities is pretty appealing. Like everything in programming it's a trade off.