gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

OffTopic > Cross-compiling Lua Scripts for ARM

#175002 - sgeos - Sun Aug 15, 2010 2:26 am

I have x86 and ARM versions of Lua and my engine, but obviously I can't use scripts compiled for the x86 with the ARM version. Surely someone here has already managed to cross compile Lua scripts for ARM. Any tips?

#175008 - wintermute - Sun Aug 15, 2010 12:09 pm

Um, cross compile VM bytecode?

http://www.lua.org/manual/4.0/luac.html
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#175019 - fincs - Mon Aug 16, 2010 8:22 pm

Offtopic: for some reason precompiled Lua scripts are bigger than their source code counterparts...

#175025 - sgeos - Wed Aug 18, 2010 7:07 am

wintermute wrote:
Um, cross compile VM bytecode?

Well... luac worked and I feel really stupid. I thought I tried that. =P

fincs wrote:
Offtopic: for some reason precompiled Lua scripts are bigger than their source code counterparts...

I noticed that too. They don't compress as well either. Presumably the precompiled scripts are faster, but I'd be surprised if speed is your bottleneck.

Precompiled scripts can be really convenient. You could compile your 100+ game scripts into a single precompiled bundle and load that. Or you could compile common code into a base bundle and have a different control bundle for each stage. Each of these bundles could have any number of source files.

Presumably, with minimal fuss, you should be able to get all of this to run on iOS, Android, DS, PC, Mac and anything else you feel like porting it to. =) Also, Lua is a small language, so when it comes time to expand and utilize the division of labor, you should be able to hand your prospective scripter a book on Lua and then train them on the quirks of your specific situation. /Lua rant