Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

IMO, these are the main reasons;

1. Embeddability. You can create a game engine in a performant systems language like c++ and embed lua in it for the scripting.

2. Speed. The lua interpreter is much faster than python in general. When you throw luajit into the fix, they are not really comparable at all.

3. simplicity: lua is tiny. and one of the easier languages for non coders (game designers, artists) to get started with.

4. Effortless C interop. You can make lua bindings for anything written in c with minimal effort.

Now to this specific engine. lua has one of the simplest and most beloved game frameworks out there - Love2d. its almost a foundational game framework for so many people (like pygame in python, XNA etc), including yours truly. Its been a beginners choice for over a decade now. Grid is built on top of Love2d.

btw, just in case you are interested in a python game engine, you should try out Arcade. Its pretty feature rich and aimed at beginners.




To be clear: Python does have embeddability, but it is orders of magnitude more complicated to integrate.


Hehe, hence the word "embeddability" instead of "embeddable".


Oh yes. I used that word very precisely :D


I was half asleep when typing that comment, sorry. Too late do edit now. I meant to write:

"I believe that word was used very precisely"


To add to this, Lua has a thread-safe interpreter, which allows running multiple Lua threads in the same process. This contrasts with Python's GIL.


You could make the same 4 points about Pawn, I don't know why nobody uses it. Pawn has all of lua's strengths without any of its quirks and weaknesses.


Some reasons I might not use Pawn:

The only benchmarks I could find claims that it is significantly slower than Luajit. The official docs claim that the fastest implementation is available on fewer platforms than Luajit.

Regarding the lack of structs, the official docs say "pawn has no "struct"s, but it extends arrays so that it can mimic light-weight structures with arrays; as an example of those extensions, pawn supports array assignment and array indices can be assigned an individual "identify" (or "purpose") and even form a sub-array." but the manual's mentions of array assignment make it seem like that's just memcpy. One could imagine having bullet objects and declaring BULLET_X=0, BULLET_Y=1, BULLET_SPRITE_IDX=2, and so on, just so that when one has a bullet object and they would like to draw it at the right location they could avoid writing draw(b[2], b[0], b[1]). Having an array of untyped cells and memcpy isn't really the same as having a struct with named members. Please correct me if I'm wrong.

A lot of useful patterns become less possible when one does not have a map or set type and when one does not have coroutines. It seems like instead of coroutines Pawn includes a syntactic sugar for a switch statement that depends on a single global state variable, in which the cases can be declared like functions. This is interesting but not particularly helpful. Why can one not have multiple different state machines, multiple instances of a state machine, and so on?




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: