Why Did Apple Allow Lua on iOs?
My theories may be wrong.
Lua is open-source but it's not GPL, so there's no requirement that the end user has to be able to modify it.
Apple has restrictions against allowing apps to download and run code that "introduces or changes features or functionality of the app". They're not exactly clear on what is and isn't allowed under this rule, but it doesn't automatically prohibit the use of an embedded scripting language like Lua. It means that any downloaded scripts have to do the same basic thing as what was submitted to Apple during the review process, and it gives Apple the right to remove apps that try to loophole their way past the review process by doing something different after release. (There's an exception for educational programming apps; to qualify for this exception, the code must be viewable to and editable by the user before running it -- so things like a Lua IDE would be allowed.)
/s/ Adam