3 ms·
I’m very curious, are you running the JDK inside the app? What difficulties did you run into trying to embed an external runtime?
by aduffy 2y ago
I’m very curious, are you running the JDK inside the app? What difficulties did you run into trying to embed an external runtime?
- robrtsql 2y agoThe app is monetized by limiting the number of “runs” you can do per month. Based on iOS limitations I think we can assume this means the compilation is done on a remote server. EDIT: nevermind! I tried running a program with airplane mode on and it still worked. Now I’m really interested to hear how this was accomplished.
- lnxg33k1 2y agoDidn't Apple recently allow to run "emulators"? So code that generates code on the app store?
- glhaynes 2y agoMore like code that runs code, not code that generates code. Assuming the latter means that it's generating native code and attempting to execute it natively, that's not allowed.
- kmeisthax 2y agoCode that generates code - specifically user-specified code - has been allowed on the App Store for years now. They have a very patronizing term for it, too: "learn-to-code apps". Granted, Apple's never going to give you the entitlements necessary to make this performant or let you create separate temporary containers for compiled apps like Swift Playgrounds can. But you can absolutely ship a dev environment on iPadOS as long as you're willing to deal with those limitations.
- trollied 2y agoEmulators don't have to generate code. At the simplest level, a CPU emulator is a switch statement.
- mrbungie 2y agoEmulators don't necessarily generate code (maybe if they use JIT). They run arbitrary code, but that's other thing.
- lewurm 2y agoProbably a OpenJDK Zero VM build. That's a configuration without JIT or template interpreter, but a "plain" C++ switch dispatch interpreter that requires no runtime code generation.
- mdaniel 2y agoI felt out of the loop, thinking that Zero VM was some kind of new distro for OpenJDK but chasing <https://packages.debian.org/sid/openjdk-22-jre-zero#:~:text=See%20the%20README.Debian%20for%20details https://packages.debian.org/sid/openjdk-22-jre-zero#:~:text=...> to <https://sources.debian.org/src/openjdk-22/22.0.1%2B8-1/debian/README.Debian/#L4 https://sources.debian.org/src/openjdk-22/22.0.1%2B8-1/debia...> lead me to https://github.com/openjdk/jdk/tree/jdk-22-ga/src/hotspot/cpu/zero https://github.com/openjdk/jdk/tree/jdk-22-ga/src/hotspot/cp... It seems that it's a specific CPU target for the Hotspot JIT for non-mainstream architectures (or for research purposes, as I saw mentioned once)
- saagarjha 2y agoNo, it's just a tier where it doesn't JIT. You can build it for your computer, too.
- Rohansi 2y agoI don't have a compatible device but I'm curious how the pricing works. Does it work like a subscription where you pay monthly for unlimited runs per month? Or do you just need to pay for enough runs and buy more if you run out?
- coolius 2y agoI got OpenJDK 17 to compile for iOS, but I had to disable JIT compilation as iOS doesn't allow running unsigned Code. Running the JVM itself is possible as long as the binaries are signed, and located at the correct paths. The paths issue really made me jump through hoops because Apple doesn't sign binaries unless they are bundled in Frameworks at the root of the bundle. That forced me to create symlinks to replicate the directory structure expected by the JVM while satisfying Apple's stupid policy. Of course this whole thing only occured when I tried to submit to the App Store and the whole app was finished. I wasn't going to give up at that point.
- cyberpunk 2y agoIs there any technical reason why one couldn’t run e.g clang or go compilers in this way? I assume you’re running javac on-device?
- throwaway11460 2y agoNo technical reason, but you won't be able to run a compiled binary due to policy. You need to use an interpreter.
- cyberpunk 2y agoI wonder if qemu with cpu=host counts...
- greenavocado 2y agoMaybe run a VM inside Safari via QEMU and WASM that boots a Linux desktop environment
- lxgr 2y agoWASM is indeed one possible workaround. That's how a-Shell [1] manages to include a C compiler and run resulting programs at (I believe) better-than-interpreted speeds. [1] https://holzschu.github.io/a-Shell_iOS/ https://holzschu.github.io/a-Shell_iOS/