HACKER Q&A
📣 lumBerry

Any Recommendations Around Programming on an iPad?


In particular, trying to learn C and run basic code snippets/small programs on my iPad.


  👤 jerf Accepted Answer ✓
Describing why you're stuck on an iPad might help improve the suggestions. Do you have a keyboard already or other input hardware? Are you trying to learn just on a bare iPad?

If you're not for some reason stuck on an iPad, it really isn't a snarky answer to just say don't. It might be marginally better than a phone, which is itself somewhat better than trying to learn programming on a game console, but you are way down on the bottom of the list of best tools, and unless you really have no access to any "real computer" and can't possibly afford to acquire even a $100 used laptop or scrounge up a random computer from somebody, which will blow away the iPad on the programming front no matter what OS you put or leave on it, you're really swimming uphill putting barriers in front of yourself in a context that really benefits from a reduction of as many barriers as possible. Programming's hard enough as it is without trying to fight the hardware.


👤 gregjor
1. iSH. Works, a bit slow and buggy.

2. repl.it supports C and C++ through a browser. They have a free plan.

3. Set up a small VPS at DigitalOcean, AWS, Google Cloud, etc. and ssh into that. You get the most control that way. A VPS costing less than $10/mo will work.

I work exclusively on an iPad as a full-time programmer and system admin, but mostly I do that over ssh to remote servers owned by my customers.


👤 wilsonnb3
It's not worth it.

If you don't have access to any computer running windows, linux, or macos then I recommend buying an old Dell or Lenovo laptop on ebay for <$100 and putting a lightweight linux on it.

It doesn't take much computing power to run a c compiler and a text editor, you can probably find something suitable for less than $50 on your local Craigslist.


👤 bitwize
Programming on an iPad is like playing football in a tuxedo: possible in principle but you're really gonna want to use the equipment made to suit the activity.

Get a laptop, put Linux on it. (Or use a Mac, I don't care.) In terms of ergonomics and available tooling, it's much better suited to C development than an iPad is. Most of the iPad solutions will involve shelling out to another computer anyway.


👤 __alexander
Check out GitHub Codespaces

https://github.com/features/codespaces

I have used it for learning C, Rust and Go. It even has a VSCode editor in the browser. It’s pretty easy to setup. Create a repo, add a hello_world.c, push the code, then in the UI press the green Code button on the repo homepage, select “Create Code Space on main” and then use gcc from the terminal to compile the code.


👤 mikeocool
I’ve been using GitHub Codespaces for a remote environment with the Blink Shell app to run VS Code.

(Codespaces can also run vscode directly in safari, but I find I run into fewer weird UI issues in Blink)

Personally, the lightness/portability of this setup has made it worth dealing with occasional issue related to coding on the iPad. Biggest issue I’ve run into is using Codespaces with really bad internet is pretty much a no go — can’t code on airplanes.


👤 duped
This is an accuracy vs precision question - an iPad is not an appropriate tool for the job even if there are hacks to get around its limitations. You should consider buying a different device for this purpose. You can learn C on a Raspberry Pi if budgets are tight but if you have an iPad then your budget probably isn't that tight.

👤 transpute
"Coding on iPad using self-hosted VSCode, Caddy, and code-server", 70 comments, https://news.ycombinator.com/item?id=41448412

Like "The Best Camera is the One You Have With You", iPad could be the industry defacto dev environment, when away from a laptop/desktop. It could rival iPhone in ubiquity, because there's little competition in tablets. Pixel Tablet is a distant runner up in specs, but offers OS/app flexibility.

iPad Pro M4 already runs VMs (Secure eXclave), but Apple leadership refuses to give customers access to an iOS CLI shell running in an isolated VM. Until Apple stops ignoring the requests of their multi-device customers, it's best to invest in other platforms, using the iPad as a dumb client.


👤 massung
If you truly want to be _coding_ on an iPad - and executing what you code - I think the options you have are the following:

* Use a 3rd party service like ReplIt (https://replit.com) or Code Anywhere (https://codeanywhere.com/pricing). These are fine, and have native iOS apps used to connect to their services as well.

* Pay for a cloud instance and use an SSH tool to connect to it.

The downside to these two options (depending on your needs) is that you are pretty much just targeting Linux and building CLI apps. But that may be totally fine for you.

Personally, I pay $60/year for SplashTop (https://www.splashtop.com), setup a SplashTop server on my home computer, and then use the iOS client to connect to the my home computer and continue programming. And I get the benefit of being able to do other things as well (like playing Steam games) if I want.

Edit: similar to SplashTop, you could also - if interested in Windows - pay for a Shadow PC (https://shadow.tech) and connect to that.


👤 wordToDaBird
You can do the VPS, and SSH thing.

As far as apps, I am not too sure what’s available, I know you can do swift playgrounds and that might have a C binding. (I checked there doesn’t seem to be a straightforward way to do C in swift playgrounds. Bonus content: https://github.com/uraimo/Awesome-Swift-Playgrounds )

What I do for most of my coding on iPad is use Google Colab. https://colab.research.google.com/

It’s a Jupyter Notebook, but you can get most things including working with C. The below link confirms C can be bound to and how.

https://blog.jupyter.org/interactive-workflows-for-c-with-ju...

As a matter of point, iPads aren’t really set up tool wise for programming. You can force something into this niche, but you probably want a computer for coding, because a significant portion of programming is massaging the system into doing what you need.


👤 kbn
Try iSH iOS app[1],from there you can install GCC to run C code [2].

[1] https://github.com/ish-app/ish [2] https://www.reddit.com/r/ish/comments/r9irjs/ish_with_cc/


👤 AlexeyBrin
Apple actively discourages most attempts to make the iPad more programmer friendly so while the hardware is perfectly capable, the software that runs on it is not meant for developers.

If you are Ok with a Terminal only workflow and you only care about C programming as in learning just the language, you should be able to do it.

Install iSH from the App Store. With iSH installed you can use the apk package manager to install VIM and GCC. You should be able for example to follow a basic book intro to C. iSH, while based on 32 bits Alpine Linux, it is not a complete operating system, so if you care about low level Linux programming you will be better off with a second hand laptop with Debian or Ubuntu on it.

Even a Chromebook with Linux enabled will run circles around your iPad from a programming point of view.


👤 Terretta
I have not tried this, but "Pyto" (https://apps.apple.com/us/app/pyto-python-3/id1436650069) claims:

Pyto is an IDE for iPhone and iPad with a Python 3.10 Interpreter and all of the standard libraries plus more than 100 third party packages, as well as a C & C++ compiler and bitcode interpreter. Includes a terminal with standard UNIX commands, a code editor with code completion, support for Shortcuts, Picture in Picture, a graphical interface builder and a debugger.

Both Pythonista and Pyro allow learning Python, though Pythonista runs behind on Python versions, and doesn't claim to have C and C++ compilers that can make CLI tools.


👤 layer8
This is difficult, in particular if you have no additional budget. You could try iDOS [0] (for $0.99) and run Turbo C++ [1] on it.

If online is fine, you could obtain a free cloud VM/VOS [2], ssh into it and use the usual Unix C development tools there.

[0] https://apps.apple.com/us/app/idos-3/id1580768213

[1] https://winworldpc.com/product/turbo-c/3x

[2] https://github.com/cloudcommunity/Cloud-Free-Tier-Comparison


👤 e12e
There was recently a related story on porting godot to the iPad:

https://news.ycombinator.com/item?id=41415077

Unfortunately I don't think this is available (yet) as an app or patches to actually run on an ipad?

It's a shame, I think a modern game engine with ide and a modern tablet could be pretty close to a pragmatic dynabook and smalltalk combination.

Speaking of Smalltalk, there's:

https://squeak.js.org/

Ed: and:

https://newspeaklanguage.org/index.html


👤 jamesgeck0
As others have noted, the least painful way to accomplish this is to use the iPad as a terminal that accesses some external server.

If you want to work offline, I've heard of folks carrying around a small "sidecar" computer the iPad connects to via USB or bluetooth. Rui Carmo has a [description of his setup here](https://taoofmac.com/space/blog/2023/09/09/1820).


👤 ivanjermakov
1. SSH to VPS/homelab server using Termius[1]

2. On jailbroken iPads, UTM[2] VM running x86 linux should run great

3. iSH[3], it was quite sloppy for me, YMMV.

[1]: https://termius.com/

[2]: https://getutm.app/

[3]: https://apps.apple.com/pl/app/ish-shell/id1436902243


👤 shoggouth
Get a good SSH app and connect to SDF[0] (which is NetBSD).

[0]: https://sdf.org/


👤 coolcoder613
Maybe you should try joining a pubnix/tilde, like ctrl-c.club, tilde.team or blinkenshell, and sshing into there from the iPad.

👤 jiggawatts
I agree with the general sentiment of “don’t”, but there are options for someone needing to travel light or whatever.

For example, GitHub Codespaces is just a web site and gives you access to a virtual machine with Visual Studio Code. It’s nearly the desktop experience but ought to work fine on an iPad… if you’re well connected with WiFi or 5G!


👤 jareklupinski
reading through the comments, i remember how my first 'server' was a hacked Xbox made to run linux

as a kid, it was easier to buy a used Xbox with cash (as-is and heavily worn) and pick up a couple Linux administration books from the bargain bin (with script examples that still worked!), than find a hosting provider that was willing to take me on as a customer without an ID or permanent residence

is it possible to learn programming from scratch in 2024 without a credit card?


👤 hprotagonist
secureshellfish or blink.sh; remote to a real computer, treat your ipad as a thin client.