Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

IMO it's always strictly better to use something real, like LUA. WoW uses lua as a programming language for user interface and users can make their additions (addons and macroses). A lot of users, who don't know anything about programming, can successfully use those lua snippets.

Also when real programmers have to interact with those systems (and my practice shows, that business users don't want to program, they ask programmers to do it), it's so much pain to use those GUI languages or whatever and it's so easy just to write some code in sane language.



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.


Serious question, whats the difference between executable lua and executable json regarding apple restrictions?


JSON 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.


Lua isn't executable either. The point at which it results in some corresponding machine instructions wouldn't be much different in this case.


ELF 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.


What'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.


To 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/jsconte...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: