A proof-of-concept Python executable built on Cosmopolitan Libc (2021)
ahgamut.github.io
ahgamut.github.io
But the reality is a bit different . The article states that their result is slow and passes one third of the regression tests. So it's a proof of concept, not a portable executable one can use for real-world projects.
As Cosmopolitan Libc has evolved, it has been possible to compile more software without modifications, and that includes latest Python through a project called superconfigure[1].
Last person who tried to reproduce it from scratch did it last week (granted it too them a few days of solid work) but in the end they ended with a portable binary with Python 3.11.9, brotli, ssl and asyncio for their work related project.[2]
[0] https://github.com/jart/cosmopolitan/tree/master/third_party... [1] https://github.com/ahgamut/superconfigure/ [2] https://github.com/croqaz/cpython/
Double so since Python code (.py) is itself portable, and I would assume that the amount of work to make all the necessary extension be built into your APE vs just using the standard pip/pipenv/poetry/etc to be in favor of the latter.
Not even talking about the maintainability of the resulting system by other people who'd have to learn how to handle building an APE.
In my use case, the niche is not having WSL/Docker available and letting end users repeat studies or re-run configuration scripts.
Adding it here since a few people were wondering about it in the comments, but feel free to check the original article for the 2024 update:
https://cosmo.zip/ Also contains a python build https://cosmo.zip/pub/cosmos/bin/python , though I'm not sure if the problems mentioned in the article are solved.
For other architectures like Power/armv7/i686 the software can run using the Blink project [0] [0] https://github.com/jart/blink
For reference, I kept notes on the exact commands I used: https://github.com/9001/copyparty/blob/hovudstraum/docs/nuit...
Wrote a simple program to which I added Fire to parse arguments as a CLI, and Gooey/Tkinter for a GUI on top of it. To get a working standalone .exe file which does not require folders on the side, Pyinstaller did the job. Unfortunately it also triggers antivirus scans for some AVs..
python -m nuitka example.py --no-compile
Might be interesting to see if the above is possible. We could get things like a completely-statically-compiled Python stdlib within the APE.- https://twitter.com/JustineTunney/status/1726141024597324189...
What exactly looked slow to you?
Maybe Flask is forking on each request, which I could imagine being slow, but not slower than the initial process startup.
Python is Actually Portable - https://news.ycombinator.com/item?id=32245430 - July 2022 (120 comments)
Is this not, in some perverse way, reflective of our contemporary technological striving, where the ideal of universality often crumbles under the weight of practical limitations?
Are we not, in our pursuit of perfect tooling, always chasing a mirage? The reality, starkly exposed by these tools, might be that our pursuit is as flawed and fragmented as the tools themselves.