We also have functionality in bitrig to build your app and send it to App Store Connect so you can deploy it on TestFlight.
Section 2.5.2 in "App Review Guidelines" (https://developer.apple.com/app-store/review/guidelines/):
2.5.2 Apps should be self-contained in their bundles, and may not read or write data outside the designated container area, nor may they download, install, or execute code which introduces or changes features or functionality of the app, including other apps. Educational apps designed to teach, develop, or allow students to test executable code may, in limited circumstances, download code provided that such code is not used for other purposes. Such apps must make the source code provided by the app completely viewable and editable by the user.In a sense, this isn't very different from what React Native does (run interpreted code that calls out into native code), just with Swift instead of JavaScript. There used to be JavaScript-specific requirements in the guidelines, but that has been loosened since Swift Playgrounds was released. Now there are Python IDEs, Jupyter Notebooks, and other apps running arbitrary code in the App Store.
What's the performance like?
The places you can hit performance issues are things like when the app itself has a tight loop that's doing a lot of work.
>To make it possible to instantly run your app, we built a Swift interpreter. But it’s an unusual interpreter, since it interprets from Swift… to Swift.
I can't understand what they're talking about, and I don't know if it's because I know too little about programming languages or if it's because they're using unusual semantics.
"a compiled language" makes no sense to me because the language itself doesn't determine whether it's compiled or interpreted. It's just a function of what compilers/interpreters exist. I could write an interpreter for C or a compiler for Python, but the languages themselves aren't compiled or interpreted.
I also don't understand what it means to "interpret" Swift to Swift. Do they mean they compile Swift to Swift (or the more modern "transpile" which means the same thing)? But it sounds like they're doing something dynamically at runtime, so it sounds more like decompiling machine code back to Swift, but the rest of the post doesn't match that interpretation.
Bitrig runs Swift apps which are dynamically generated by an LLM on the iPhone, despite the iPhone strict security provisions (e.g. inability to write executable pages of memory). The way we do this is by parsing the generated Swift code and mapping that to the compiled calls to the libraries that come in the OS. It's pretty weird, but we think it's worth it to get the ability to immediately render the generated code on the phone.
We're very interested in using the interpreter to improve the Swift developer experience in more ways like that.