Hacker News new | ask | show | jobs
by zie 1 day ago
There is also the APE/Cosmopolitan cross platform binaries, which includes a python. Yes, cross platform binaries. The binaries run "natively on Linux + Mac + Windows + FreeBSD + OpenBSD 7.3 + NetBSD + BIOS with the best possible performance and the tiniest footprint imaginable."

* Python Source: https://github.com/jart/cosmopolitan/tree/master/third_party...

* Python Binary: https://cosmo.zip/pub/cosmos/bin/python which is ~ 40MB.

Apparently you can zip your .py files in with the python binary and make it run, but I haven't had a chance to try and play with that yet.

2 comments

so in theory, one could program a game in python and then complete and distribute one binary for everyone?
speaking of Cosmopolitan, is postgres supported within Cosmopolitan. I would like to know because I would love a static cross platform postgres
Not PG no. At least not yet. I wonder if they can get WASM to work, which seems to be working roughly the same problem from a totally different starting point and perspective. I'm pretty sure PG binaries for WASM do exist though.
I think that you might be talking about pglite.dev when talking about wasm from my understanding, Wasm has a performance hit though from my understanding and unless one plans to run postgres on web.

on the other hand a static cross platform single binary Postgres binary doesn't really have any performance hit.

(anecdotally, Personally I would be interested for something like this existing and maybe even integrating it with golang embed. Some of my apps are full stack golang with sqlite backend all baked into a single static binary which I can run and be cross-compiled but I would like to have the same level of flexibility but with postgres as well hopefully)

Yes, I'm sure the WASM binary for PG has a big perf hit. If you are just using it for testing, it probably doesn't matter?

Why does the perf hit matter to you? Are you trying to run WASM binaries of PG in production? That seems like a terrible idea.

No, I am not running WASM binaries of PG in production given its perf hit but I would like to have the simplicity that I have with sqlite.