[HN Gopher] Show HN: I Built a Java IDE for iPad
       ___________________________________________________________________
        
       Show HN: I Built a Java IDE for iPad
        
       Includes OpenJDK 17 and IntelliSense. I don't know what led me to
       make this but here it is.
        
       Author : coolius
       Score  : 73 points
       Date   : 2024-04-30 15:21 UTC (7 hours ago)
        
 (HTM) web link (apps.apple.com)
 (TXT) w3m dump (apps.apple.com)
        
       | aduffy wrote:
       | 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 wrote:
         | The 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 wrote:
           | Didn't Apple recently allow to run "emulators"? So code that
           | generates code on the app store?
        
             | glhaynes wrote:
             | More 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.
        
             | trollied wrote:
             | Emulators don't have to generate code. At the simplest
             | level, a CPU emulator is a switch statement.
        
             | mrbungie wrote:
             | Emulators don't necessarily generate code (maybe if they
             | use JIT). They run arbitrary code, but that's other thing.
        
           | lewurm wrote:
           | Probably 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 wrote:
             | I 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=...> to <https://sources.debian.org/src/openjd
             | k-22/22.0.1%2B8-1/debia...> lead me to https://github.com/o
             | penjdk/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)
        
           | Rohansi wrote:
           | I 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 wrote:
         | I 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 wrote:
           | Is 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 wrote:
             | No technical reason, but you won't be able to run a
             | compiled binary due to policy. You need to use an
             | interpreter.
        
               | cyberpunk wrote:
               | I wonder if qemu with cpu=host counts...
        
               | greenavocado wrote:
               | Maybe run a VM inside Safari via QEMU and WASM that boots
               | a Linux desktop environment
        
           | indigoabstract wrote:
           | I don't use Java much these days, but for some reason I find
           | this project inspiring. If only because of the level of
           | commitment to get it working.
           | 
           | I just wanted to say great job!
        
       | sdwr wrote:
       | In university, my friend used an iPad for all his notetaking. He
       | had a keyboard for it, and used it like a little laptop. Bet he
       | would have been all over this!
       | 
       | The UI is good, looks clean
        
       | criddell wrote:
       | Can you use it to write iPadOS applications that you compile and
       | run on the device?
        
         | davely wrote:
         | This is my biggest hang up about the iPad. Hardware is great.
         | The OS is... passable. Sort of.
         | 
         | For me: I can't do computer things that I want to do (mainly
         | code, but sometimes game, etc).
         | 
         | I ended up buying a used Surface Pro X. A bit slow, but I like
         | that I can run something like VS Code and a Node server, or
         | even a real web browser with network debugging tools, all using
         | a touchscreen while on a bus or in an airplane.
         | 
         | (For my gaming fix, I find that GeForce Now or Moonlight work
         | pretty well for streaming my existing games -- not as practical
         | to do on a bus though.)
        
           | criddell wrote:
           | I understand what you are saying. The iPad is the best choice
           | for some people and the worst choice for others. I have an
           | older iPad Pro and it's by far my favorite computer mostly
           | because it doesn't really feel like a computer.
           | 
           | My favorite apps are Procreate and GoodNotes. For me, either
           | one is a killer app that justifies having an iPad.
           | 
           | I also have a ThinkPad for my personal projects and a desktop
           | workstation for my job. Each machine has its strengths and
           | weaknesses. Each was chosen because it was a great choice for
           | what I need to do with it.
           | 
           | I'm one of the few people that hope the iPad doesn't get more
           | computer-like. I miss the days when you had an Atari or Amiga
           | or PC or Mac and they were all very different and exciting
           | and in competition with each other. Now we are approaching a
           | very boring endgame where cross platform apps look the same
           | everywhere and there's nothing fun about any of it.
        
         | alexpc201 wrote:
         | That's the main drawback I find with the iPad. So much memory,
         | so much processor, and not being able to use an app that allows
         | me to create iOS apps. It's the reason why I only have an old
         | iPad Air, it's enough for browsing, reading ebooks, and
         | watching a movie on a trip. Anything bigger would be too bulky
         | with the MacBook.
        
           | sharkjacobs wrote:
           | > and not being able to use an app that allows me to create
           | iOS apps
           | 
           | Maybe you already know about this and you just mean there
           | isn't an app that provides the equivalent of your full MacOS
           | dev environment, but you can absolutely build and run iOS
           | apps on your iPad with Swift Playgrounds.
           | 
           | It has a lot of shortcomings, but I've used it to create a
           | couple little personal apps that I can run without
           | distributing them through the App Store.
        
         | rock_artist wrote:
         | While not perfect. For Swift, I've actually doing initial app
         | development using Swift Playgrounds.
         | 
         | I'm even maintaining project that still keeps working as Swift
         | Playgrounds.
         | 
         | Here is an open source example of such:
         | https://github.com/talaviram/OpenSpoken/tree/main/OpenSpoken...
         | 
         | But I also have internally a bigger app that is doing similar
         | approach (not open source code though) -
         | https://www.smartercurrency.app
         | 
         | I've yet tried and I guess it's limited for trying to do any
         | ObjC++ / C++ / Metal. But I do believe Apple is using
         | playgrounds as a playground for Xcode successor.
         | 
         | The biggest issue though, is version control (git...) which
         | requires more work to get things properly.
        
       | jorgeleo wrote:
       | So... Continuous for Java? Meaning it can compile and run in
       | device?
       | 
       | https://apps.apple.com/us/app/continuous-net-c-and-f-ide/id1...
        
         | rcarmo wrote:
         | So far, sort of. Continuous does have the advantage of having
         | both C# and F# (although it's a bit crashy these days on modern
         | iOS). I can take the code I test there and build it on a
         | desktop system as well, but haven't figured out how easy it is
         | to round-trip stuff in this yet (should be as easy, if not
         | easier, but re-using libraries might be trickier).
        
       | pquki4 wrote:
       | The app store page doesn't mention debugging, so I assume it's
       | not there.
       | 
       | And probably not "go to definition". Completion quality is also
       | questionable. These are very hard problems, even for a language
       | with strict typing like Java. It's not easy to get these basic
       | lookups correct and smooth.
       | 
       | Personally I wouldn't call it an IDE (yet).
        
       ___________________________________________________________________
       (page generated 2024-04-30 23:00 UTC)