News for hackers. Stuff that matters.
Re:Projects: Back to C by fit2rule on Saturday August 18, 2018 @05:54AM (#17787746)
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.
Re:Projects: Back to C by deorder on Saturday August 18, 2018 @06:23AM (#17787825)
I 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.
Re:Projects: Back to C by oweiler on Saturday August 18, 2018 @05:59AM (#17787765)
How do you run Lua on iOS?
Re:Projects: Back to C by mpweiher on Saturday August 18, 2018 @06:02AM (#17787775)
Include the Lua interpreter in your executable and the Lua code in your resource bundle?
Re:Projects: Back to C by fit2rule on Saturday August 18, 2018 @04:53PM (#17790619)
Exactly. 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 ..
Re:Projects: Back to C by deorder on Saturday August 18, 2018 @06:03AM (#17787777)
Even Apple uses Lua on IOS according to the following tweet: https://mobile.twitter.com/_inside/status/102617383252726579...
Re:Projects: Back to C by fit2rule on Saturday August 18, 2018 @04:50PM (#17790594)