Codea versus a normal app

Suppose my game runs at 40 FPS in codea. If make a app out of that game and run it on the ipad just like any other application will it run At 40FPS or faster??

I’m not sure myself as I haven’t published any apps created using Codea, but I’d assume it would run faster since the standalone app won’t include the debugging window and other options like screenshot and video recording.

And the conversion between two languages

@Luatee, conversion between two languages? Does codea convert lua to something else…

Does lua run in objective C? I know it can be used in c++ with libraries so I guess maybe it can, but does it still not require some sort of conversion?

@Saurabh the exported version should run at a similar speed and use less memory (RAM) than the Codea version.

Oh, so exporting to xcode would only be useful if you want to submit to apple, cause it won’t improve any speed. @Luatee, I have no idea about it.

@Slashin8r You can actually have the debugging window in your actual app, the only way to disable it is displayMode(FULLSCREEN).

@Luatee @Saurabh Codea has to convert the Lua code to Objective C, Lua code cannot be ran on an iPad without something like Codea. Every app on the App Store is made in Objective C, and only Objective C can be ran on an iPad. Also, there’s differences between C, C#, C++, and Objective C. They are related, though, but not related enough to run an Objective C program in C++.

Thanks, @SkyTheCoder.

There is a lua compiler for the llvm backend and as far as I know it’s capable of generating native code for iDevices. If it works and is reliable, integrating compiled lua code would be no worse than integrating C++ code, or C code like the lua interpreter. But that’s still a lot more complex than simply running the interpreter, and then some things you can do in dynamic languages don’t translate well to native code, and you would still need to keep the interpreter around anyway for functionality like loadstring(). I’m not 100% convinced it’d be worth it. You can rewrite parts of your lua code in ObjC/C/C++ when you export the project, so you can optimize selectively.

Note that GLSL is compiled to GPU native code, even though that happens at app run time. But your shaders will be exactly as fast in Codea as they would be in any other app.

@SkyTheCoder that is not quite the case. The iPad (and iPhone) run ARM assembly. This is because thees devices have CPUs which use a version of the ARM instruction set. Apple provides compilers for Objective-C, C++, and C based on the LLVM optimiser and Clang front-end.

The Lua code is never converted to Objective-C. It is interpreted via a C runtime, which at times makes calls out to C and Objective-C functions, which are of course compiled into native ARM code.

@Simeon, would that not make a difference to the speed then? I’m not sure what the difference between interpreting and converting in this scenario but I imagine it uses more memory which could have an FPS increase when compiled?

@Simon Huh… You learn something new every day.