4 ms·
Making python scripts into an 'Actually Portable Executable' is what really interested me here.
by cdchn 3y ago
Making python scripts into an 'Actually Portable Executable' is what really interested me here.
- fermigier 3y agoIs this the reason why there is only one 5+ KLOC module (which includes the tests)? I personally prefer short / shorter modules with clear responsibilities.
- tekknolagi 3y agoNo. This is not a limitation of APE/Cosmopolitan. This is just my personal preference because imports get tricky in Python land unless you either have a single file or go Full Package Mode. There's probably a world where we split the tests out, though.
- fermigier 3y agoWell, just to better understand how the code is organized (and experiment a bit with it), I have forked it: https://github.com/sfermigier/scrapscript/tree/trunk/src/scrapscript https://github.com/sfermigier/scrapscript/tree/trunk/src/scr...
- semi-extrinsic 3y agoNot just python scripts, you can package any C code as well. We've used it to compile up a "python.com" APE file with a python 3.11 interpreter that has lots of packages (including C extensions) that we can just drop straight into old airgapped lab instrument computers and get a modern python data analysis suite up and running.
- actionfromafar 3y agoNow integrate Shedskin the Python compiler. :)
- semi-extrinsic 3y agoThanks, TIL. Now we can combine this with the xlcalculator package and transpile models built in Excel right down to C code and build it as a portable executable.
- mst 3y agoThat's both terrifying and wonderful and I hope to see a write up of it on the front page one day :)
- cl3misch 3y agoThat sounds very interesting! I probably could hack it together myself, but do you happen to have a writeup on that, or maybe some pointers on how to include the numpy-scipy stack into the executable?
- iainmerrick 3y agoI'm a little confused by this part: This executable is theoretically runnable on all major platforms without fuss. And the Docker container that we build with it [...] It sounds like they're putting an APE inside a Docker container, but why would you want both?
- zilti 3y agoBecause some people throw a tantrum if it doesn't come pre-dockerized, I suppose
- zem 3y agoperhaps to integrate with tooling that wants to work with containers
- tekknolagi 3y agoYep, to deploy on fly.io
- cl3misch 3y agoNo, they build the APE with a docker container. The APE itself is... actually portable.
- tekknolagi 3y agoWe do both. We also deploy a Docker container that runs scrapscript.com