3 ms·
Why not Lua? If you think you can do it in C, you can do it with Lua and end up with a system 10x better.
by fit2rule 8y ago
Why not Lua? If you think you can do it in C, you can do it with Lua and end up with a system 10x better.
- oweiler 8y agoHow do you run Lua on iOS?
- mpweiher 8y agoInclude the Lua interpreter in your executable and the Lua code in your resource bundle?
- fit2rule 8y agoExactly. People seem to have this misunderstanding that you can't use Lua on iOS "because only approved languages make it into the App Store" - not true. I've shipped tons of Lua-based iOS apps ..
- deorder 8y agoEven Apple uses Lua on IOS according to the following tweet: https://mobile.twitter.com/_inside/status/1026173832527265792/ https://mobile.twitter.com/_inside/status/102617383252726579...
- fit2rule 8y agohttps://gist.github.com/lgastako/2243243 https://gist.github.com/lgastako/2243243
- deorder 8y agoI do that for my own game engine. Wrote a very thin layer in C (C99 to be exact) that has all the low-level stuff, tight loops and things that require to be data-oriented. I do everything else on top in Lua. I use libclang to automatically create the Lua bindings from the C code using annotation attributes (X is just a macro around `__attribute__(())`), for example when using `X(ADD) xvector2_t xvector2_add(const xvector2_t a, const xvector2_t b)` it will make sure that this function is called when using the `+` symbol between 2d vectors in Lua. When needed (for performance) I can always move things from Lua to C.