Hacker News new | past | comments | ask | show | jobs | submit login
PEP 730 – Adding iOS as a supported platform (python.org)
79 points by tosh 10 months ago | hide | past | favorite | 77 comments



I think this is a mistake. iOS is not a normal platform, it offers no backwards compatibility guarantees. Apple can add new restrictions or remove APIs at any time. This means that Python can’t offer backwards compatibility guarantees either.

Moreover it’s expensive to develop for iOS as you need a semi-recent Mac. You can’t even virtualize MacOS because Apple bans virtualizing it except on Apple hardware. That matters for an open source project where everybody should be able to contribute.

The better way to do this would be for Apple to contribute iOS support themselves. To have a good experience with Apple you really need someone on the inside who can cut through the BS (though sometimes even that doesn’t help).


I’m sure it’d upset you to find out that macOS itself is a current first class Python target. The fact that Python on macOS seems to be doing just fine should probably serve as an indication that your concern is rooted in ideology rather than any actual issues.


Isn't macos POSIX? Is iOS POSIX?


macOS is POSIX. iOS is clearly not (though it provides many POSIX APIs).


iOS is using Posix tech in the background. It is surprisingly even using gnu tools in the background


https://github.com/sickcodes/Docker-OSX

Not sure about the law but I’ve been running MacOS in a VM for a while for compiling things


> iOS is not a normal platform, it offers no backwards compatibility guarantees. Apple can add new restrictions or remove APIs at any time

Oh, like macOS you mean?

> Moreover it’s expensive to develop for iOS as you need a semi-recent Mac

It seems to be possible to create an App Store app on an iPad using Swift Playgrounds:

"And when you’re done, it’s easy to share your creations with friends, or even submit your app to App Store Connect."[1]

[1] https://developer.apple.com/swift-playgrounds/


OSX is POSIX, is it not?


If you stick to cross-platform standard APIs (POSIX, X11, Java, web/Firefox, etc.) you are probably OK.

The constant API churn is for native macOS apps that use the GUI.


macOS is one of the last certified UNIX systems left


It would be even a bigger mistake not to. Such platforms should not be ignored as they are big enough to be important.


They should. The only way to make these platform disappear is to ignore them for open source project.

To me the mistake of open source software is to make programs compatible with proprietary operating systems, this way people that use these OS benefit from the open software, while people that use open operating systems cannot benefit from proprietary software that usually is exclusively for Windows or macOS.

Beside that, this adds a lot of work to the open source community, work that could have been better invested focusing on open source and not wasting time ensuring compatibility with the latest Windows or macOS release working around crap and restrictions that these companies impose to distribute the programs in their platform (e.g. all the signing requirements, paying fees in case of Apple app store, etc.)

Not that the user of open source software cannot run it on iOS or Windows, he can, but it has to port it there themself, no official support from the developers shall be ensured. Just distribute binaries for Linux and Android.


Android and most of its binaries are in some way or another proprietary. Things like drivers and google play won‘t go away. It is the wrong approach, grow up.


It has been doing wonders for Desktop Linux and Linux mobile phones.


Okay, so perhaps we need an even stricter license than GPL.


it is a total fantasy to imagine that a few nerds can make iOS disappear by opting out.


Since I cannot install stuff from a third party on my iPhone without paying Apple (unless Apple says I can), it is clear that I don't own my phone. So it seems fair that Apple then is the one paying for the efforts of getting FOSS support on their device.


Thankfully, you and Apple aren’t the only two choices here. That’s the thing about open source, isn’t it? Someone else is free to go and do it. And they are. The system is working as it should.


> Since I cannot install stuff from a third party on my iPhone without paying Apple (unless Apple says I can)

Today, that’s only partially true, finally, depending on where in the world you live.


> Since I cannot install stuff from a third party on my iPhone without paying Apple

That’s weird. When I browse the App Store it’s full of free apps.


You stopped reading at "(unless Apple says I can)"


That’s a weird way to say the developer decided to provide it for free


Python seems to do pretty well ignoring iOS.


Well Android and Windows are starting to struggle with marketshare so… not everyone wants to be converted to Linux and that is a fact


Such platforms should be ignored by everyone way before they become big.


A Mac mini is a few hundred dollars.

All development is expensive. The hardware has little bearing on the total cost.


Developing for any other platform is zero dollars in terms of hardware cost.


How exactly do you write/test your code on free hardware?


That is bullshit. You always need the hardware, most need a server. There is a difference between programs and applications - ffmpeg for example is not an app, but a program.


Of course you do - but it's not a development cost per platform for any other platform except apple. If you already have a PC (which even for hobbyist devs can be taken for granted), then developing for any additional platform will not incur additional costs - except for apple.


I don't have a PC. I have a mac. If I wanted to do serious game development, I would be forced to buy a PC, if for no other reason than testing.

This is just the cost of development.


You can emulate Windows or Linux on a Mac [1]. You can't emulate MacOS on a PC, because Apple specifically disallows it, as the GP already mentioned.

[1] https://www.macworld.com/article/668848/best-virtual-machine...


Emulation won’t tell me there’s a performance issue on a 3060, or let me modify lighting in realtime in unreal editor. You wanna build seriously for pc, you need a PC.


What's "seriously"? If you just want to get a basic game running on pc, you can easily do so on a vm. Sure, if at some point you need some high-performance benchmarking or specialized tests, you need that hardware. But that's for specific types of games and even then at the end if the dev pipeline.

Whereas, if you target macs or iOS, you can't even start development before you have bought a mac.


Not really on topic but that article from March doesn’t even mention UTM.app? Boo


The author in PEP mentions, that you can use Github Actions for building of the libraries [0].

[0] - https://peps.python.org/pep-0730/#ci-resources


Doesn't that mean renting Microsoft VMs to develop Python for iOS? Github Actions don't fall from the sky like rain. They are a commercial service that happens to offer a free tier.


iOS is for the most part backwards compatible. Sure, they can remove APIs and make your life miserable in theory, but in practice they usually don't–at least, not on purpose. macOS is far worse at this actually because it started from a place of promising the world and Apple slowly realizing they didn't want to do that, while iOS has mostly come from "you get nothing" and every year you get a few new things.


> Apple bans

In practice, Apple can't enforce it. The maximum they can do is to ban sales of products with iOS on non-Apple hardware like Hackintosh etc. But they are powerless against the law in many countries, especially in Europe, which explicitly allow modification of software for interoperability purposes.


Also iOS development doesn't require a Mac, you can do apps without one on Linux, you will just be on your own for tools (but for example if you make an app with theos on CLion you will get completion for Objective-C, and it was not that bad imo)


How do you build and distribute them?


GitHub.com as source. This is currently possible today, with iOS ides like Pythonista, Beeware, and Kivy. you don't get a neat app to s distribute but you can run python code on iOS today. This PEP is to make iOS a supported platform for the reference implementation, CPython.


With theos, and I install them through SideStore or directly sideload them as a dev on my device. I could use App Store Connect if I had a dev account for that too


> The better way to do this would be for Apple to contribute iOS support themselves.

Why would you wish Embrace-Extend-Extinguish onto Python?


> it’s expensive to develop for iOS as you need a semi-recent Mac

I'm so tired of this bullshit argument. No it's not expensive to develop for iOS. You can get an M2 Mac Mini for $599. Upgrade it with more memory and storage and you're still well under $2k. How is that expensive? If you can't afford the $2k for a Mac then you certainly can't afford the developer who has to use it.

There are few professions that require at little investment in tools as a fraction of the salary of the professional using those tools as software development. Go ask a carpenter how much they spent on tools and how much they get paid.

"But what about people who program as a hobby" I hear you say. Again, it's one of the cheapest hobbies you can possibly have. Have you ever talked to anyone who had any kind of hobby? Ask anyone who is a hobby musician how much they spend on instruments. Ask a hobby photographer how much their equipment is worth. Ask anyone who's into arts and crafts what they spend on their hobby. Hobbies cost money, and most cost a lot more than a new Mac every couple of years.


Even 600$ is quite a bit of money for a small open source project, especially outside of first world contries. You cannot except every single open source developer to buy somewhat overpriced hardware just to publish it in one platform.

None of the other desktop/mobile platforms require specific hardware , Windows/Linux/Android can all be virtualized/cross compiled to. The only reason you cannot cross compile/virtualize from other platforms is because Apple doesn't want you to. Its possible, there are projects that allow you to do so, but it violates Apple's license.

https://github.com/tpoechtrager/osxcross

Also its not fair to compare hobbies like photography or music to programming, you don't need any physical hardware other than a computer for majority of the cases, except testing (even that can be done somewhat reliably by virtualization), and when you are artificially forced to buy hardware just to publish to a platform.


> None of the other desktop/mobile platforms require specific hardware

But they still require hardware, and that hardware isn’t free either.


That hardware is something you use for other purposes, so it's free for the hobby. The challenge of specific hardware is that you can't use your non-specific one and have to pay


There are plenty of old laptops and PCs that you can get for free that are still supported.

You also can just virtualize other platforms.


"Hardware" is cheap, easily accessible all around the world, Apple hardware is not.


$2k is roughly six median monthly salaries in my country, which is pretty typical for the world we live in. Maybe even on the larger side. I am fully aware you don't care about most of the world and will advise us to follow some other pursuit, I've heard this many times before. (Which we do, Apple is not really relevant outside the US.)


Sheet music doesn't require me to buy an instrument from a specific manufacturer, nor do the instruments come with EULA that limit how I can use them.

Price is not the point. Some of us simply refuse to buy such products.


Way to move the goalposts there. We went from “it’s too expensive” to “price is not the point”


$2000 is expensive for an open source project where people are contributing in their free time. Are you suggesting that EVERY person that wants to work on the iOS support of python buys themselves a $2000 mac, switches their entire workflow to MacOS etc?

> Again, it's one of the cheapest hobbies you can possibly have.

No, definitly not, ESPECIALLY not for open source development.


> EVERY person that wants to work on the iOS support of python buys themselves a $2000 mac, switches their entire workflow to MacOS etc?

Those who don’t have one already can go work on something else. There’s a world of open source libraries for iOS, and no one has forced you to “want to work on” any of them. What a strange attitude, getting angry that other people (e.g. Russell Keith-Magee and Ned Deily — long time Python committer) want to do work that you can’t.


You sound like you live in a bubble. You must not know many people who have hobbies other than computer programming. Let’s say you buy a $2000 Mac and write it off in 3 years (in practice it’s more like 5, but let’s go for a worst-case scenario). What other hobby only costs $666 a year?


> Have you ever talked to anyone who had any kind of hobby?

Yes, and know plenty that are literally close to $0


Honestly so is macOS. Literally not providing any open graphics API - and all the signing shenanigans - are preposterous. The Stockholm syndrome is strong.

Oh, and did I mention the ridiculous restore mode which often necessitates using another Mac? Is this a productivity device or an overgrown iPhone?

Now I was about to say maybe MS will offer something similar ARM-based, but then I realized it will also hamstring the devices in some way, not to mention their CPU partner is Qualcomm...


It’s very telling when people tell me that I have Stockholm syndrome instead of considering the possibility that different people have different preferences and priorities. Especially when your preferences seem to revolve around a particular ideological bent.

I have no idea what “ridiculous restore mode” you’re referring to, but in 15 years of full time Mac use, including using Apple Silicon Macs from around 6 months after release, however many years ago that was, I haven’t run into a situation where this has been necessary.

Please don’t devolve another discussion into 2000s Mac bashing. Especially when your ostensible worldview is predicated on a bunch of people being stupider than you.


If you have never used the restore mode, how can you judge whether it's usable or not?


The ridiculous restore mode you’re speaking of is a break glass in case of last resort type thing, where you the user have screwed up your disk so badly that you have messed up the recovery partition and system , which is as simple as holding cmd and R during boot to get into.

In fact they really went the extra mile to ensure that you cannot possibly brick a Mac (or iDevice) no matter how hard you try. Having to do an emergency restore usually needs specialized hardware anyway; they ensure you can do it with widely available equipment. Go the Apple store if all else fails you.


OpenGL is available on macOS. The best-on-platform for Windows is DirectX12, also closed.

There are many things to complain about but spearheading a new type of graphics apis with Metal (before Vulkan and dx12) should not be one.


Of note: this PEP was authored by Russell Keith-Magee, who has been investing a mammoth amount of energy into using Python for mobile app development for a number of years now. As I recall he’s just joined the Python team. If anyone is going to push it, it’d be him.


The same kind of thing for Android, PEP 738: https://peps.python.org/pep-0738/

Supporting a mostly open source OS that's not locked down seems reasonable. Supporting iOS seems a bit strange.

The currently supported platforms: https://pythondev.readthedocs.io/platforms.html


Most versions of Android are also locked down and completely proprietary


Not in my experience. I have always been able to access the file system, sideload apps, install other app stores (yes they're a bit limited), run any browser, run command line programs, etc. It's also easy to run Android in emulators and on a variety of hardware. iOS is absurdly locked down in comparison.

Your claim that versions of Android are completely proprietary is obviously false: every version of Android uses a lot of other open source software, and runs on Linux, which is GPL.


If we are talking about any type of android phone outside of very specific/obscure models, this is misleading. Although android is technically free software, real world phones are compromised by both carriers (e.g. Verizon) and manufacturers (e.g. Samsung).

You may be able to sideload apps, but you're still limited to the few APIs that they allow you to use, while these corporations still have the keys to the root account. Even if you own the phone, you can't get around these controls.

even if the low-level bare-bones distribution of android is free software, the vendors almost always tack on garbage that makes it completely compromised. It's like "I may be in a prison but the fair-trade handcuffs are made by a B corporation so I'm happy"


I feel like this is Python starting to take it's position more seriously and mobile is (for better or worse) the future that has the widest reach. If Python wants to keep its ground it has to keep up, and I hope it does.

Not developing a ton of apps these days, but would be cool if I could just port of a webserver/front-end with minimal cruft in-between code and OS.


It would be insanely cool to just be able to drag together a quick UI, hook it up to some python logic and have a working app.

Ohh, things were simpler back in the visual basic days.


I'd love for them to stick with iOS 12.x as the bottom end install. I have a stack of EOL iPad Air's that run 12.5 that I could use for programming with the students I work with.


This is excellent, more native ways of integrating Python modules would be very welcome.


OMG what a nightmare. Thoughts and prayers to the brave souls who are implementing this.


I'm not sure what the goal is. Pythonista already exists on iOS for scripting.


It looks like Pythonista is meant for running Python on iOS inside Pythonista, not for building complete, full-featured apps with Python.


This would be for people embedding Python into their apps.


Got it. That is a reasonable goal but Apple might make it very difficult to achieve.


Would be nice to bundle it with Tauri




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: