4 ms·
Apple has restrictions on downloading executable code, which downloading a Lua script would likely fall afoul of. It's also a potential security risk - the dow
by josephearl 10y ago
Apple has restrictions on downloading executable code, which downloading a Lua script would likely fall afoul of.
It's also a potential security risk - the downloaded script could perform things other than logic and so would require sandboxing/whitelisting of commands.
Putting logic in JSON avoids both of these issues since the actual handling of the logic is performed by a client-side library.
- jfroma 10y agoSerious question, whats the difference between executable lua and executable json regarding apple restrictions?
- michaelmior 10y agoJSON is not executable. Although I suppose you could argue that embedding an interpreter for a DSL like this inside your app is violating the restriction.
- boomlinde 10y agoLua isn't executable either. The point at which it results in some corresponding machine instructions wouldn't be much different in this case.
- MichaelBurge 10y agoELF binaries aren't executable either: They require the kernel to interpret them, preparing virtual memory and granting it a pid. Alone, they're just sequences of bytes.
- boomlinde 10y agoWhat's your point? That you are willing to extend this principle to ELF binaries doesn't really affect my argument. My point is that for the purpose of letting some non-trusted instructions run safely in a program, encoding them as JSON or Lua will come with the same caveats. Ultimately, they are both interpreted and can be sandboxed thus. Neither contain any code that will be passed off as-is for the CPU to execute. In some cases, neither does an ELF blob.
- dirtyaura 10y agoTo my understanding those restrictions have been lifted years ago. They used them strategically to kill Flash from becoming an app development platform and still probably can use them to kill cross-platform programming kits. But having scripting code in the app is not a problem anymore - they even offer Javascript execution context library in iOS SDK that makes it easy to run Javascript without UI. https://developer.apple.com/reference/javascriptcore/jscontext https://developer.apple.com/reference/javascriptcore/jsconte...