|Lua and Squirrel overhead||February 4, 2012|
I've been researching the idea of using embedded languages in mobile applications as a way of reusing business logic across platforms. I haven't found a lot of information about how much an embedded language will bloat an app's size, so I decided to see for myself. So far, I've written simple "Hello, world" apps for both Lua and Squirrel. Lua is a simple language that has been heavily used in video games for years. Squirrel is a newer language that was inspired by Lua, but uses a more C-like syntax.
These tests are not very scientific, and only demonstrate the bare minimum task of including the language support as a native shared library, and some JNI code to run a script to generate a "Hello, world" message which is returned to the activity.
|Lua and Squirrel app delivery overhead (.apk size differences)|
|language||start size||final size||overhead|
|Lua||12817 (13K)||60089 (59K)||47272 (46K)|
|Squirrel||13530 (13K)||118520 (116K)||104990 (103K)|
|Squirrel (sans compiler)||13530 (13K)||99598 (97K)||86068 (84K)|
I haven't played around with writing code in these languages, though, so I'm curious to hear about people's real-world experiences.