5 ms·
Python's biggest issue - distribution - solved without any containerization. once this gets threads, TLS and a recent Python version, I can see it becoming a n
by baq 4y ago
Python's biggest issue - distribution - solved without any containerization.
once this gets threads, TLS and a recent Python version, I can see it becoming a non-toy fast. well done!
- bamboozled 4y agoIt's solved by using Go, 6 years ago.
- Epa095 4y agoGo builds a single binary for both Linux, Windows and osx?
- oflebbe 4y agoit builds single binaries even for other processors like arm, arm64.
- estebank 4y agoOne of us is confused, and it very well might be me and GP, but I thought that Go can cross-compile to other platforms (different OS and arch combinations), but cannot produce (at least by default?) a single binary that can run on multiple platforms, like this article does.
- ReactiveJelly 4y agoYeah Go does not do that. I don't think any lang does I think it's pretty much a unique feature of APE, because APE binaries modify their own code after the first run to nativize themselves. (Right? Or do the new versions work different?) I can't tell if my disdain for this is real (Since I really like having my exes read-only and having a consistent hash) or just sublimated envy (Since most desktops will in practice have every file marked as read-write, and if it works it's not stupid)
- bamboozled 4y agoIt doesn’t need to. It can build optimised binaries for all three.
- baq 4y agomostly yes. there's the slight problem of Go not being Python, though.
- intelVISA 4y agoor even Nim if you prefer Pythonic syntax with the same portability.
- oefrha 4y agoWhen people complain about Python distribution, having to download different binaries for different operating systems is almost never part of the complaint. So, the problem has been “solved” by pyinstaller and co. ages ago. Any problems still haunting pyinstaller and co. at this point will also show up for APEs, and solving them when you only have a lowest common denominator toolset at disposal will be harder. I like APEs btw.
- ahgamut 4y agoI got interested in APEs because I got lost in DLL hell a few times with PyInstaller lol. IMO PyInstaller is pretty cool, but a bit overkill sometimes. At present I find APE Python a perfect match for one big use case (a bunch of my thrown-together shell utilities I can take and use everywhere). Like after I wrote this blog post, I wrote a small Python app using Flask/SQLite/D3.js, put everything in a single file, just copied it onto computers with Debian/Fedora/FreeBSD/Win10, and now I just access the info I need on those systems via the browser. Providing a browser GUI makes it easier for my colleagues as well, some of whom don't use terminals at all :) For C extensions (where I've stubbed my toes quite a bit with PyInstaller), I think a nice goal with APE Python would be to have a website like Christoph Gohlke's (https://www.lfd.uci.edu/~gohlke/pythonlibs/ https://www.lfd.uci.edu/~gohlke/pythonlibs/), where you just select the packages you would like, and you download them compiled as a single-file executable you can use anywhere. This is an interesting problem, and there's been some work towards solving it, let's see if we can have an elegant solution.
- cxr 4y ago> When people complain about Python distribution, having to download different binaries for different operating systems is almost never part of the complaint. Have you done a study? This reminds me of when I've seen people say things like, "X is a showstopper for me when it comes to C++ [or whatever]", and someone responds, "That's not a problem in practice. People who write C++ don't care about X". And it's like, "Well, yeah, that's the nature of 'showstoppers'—all the people who do care about X noped out a long time ago." It's an intellectually dishonest way to justify choosing not to confront the X problem.
- ahgamut 4y agoFollow the Cosmopolitan Libc project (also consider supporting and/or contributing to it), these things are on track to happen soon :) TLS will probably happen first -- Cosmopolitan already has mbedTLS for redbean, so a modified `_ssl.c` should get us most of the way there. Recent Python versions ... what version is Python on right now? 3.10? (3.11 apparently) I picked 3.6 at the time because Cosmopolitan Libc did not have threads then (it does now, pthreads API is being filled as of this writing), and also because it wouldn't have too much churn. Perhaps after 3.11 gets stable I'll port it to use Cosmopolitan Libc.
- baq 4y agoa release pipeline for 3.11 would set the project up nicely for 3-5 years at least! definitely post it on HN if you get it working.
- jart 4y agoHere's the latest update on TLS https://github.com/jart/cosmopolitan/blob/master/libc/runtime/enable_tls.c https://github.com/jart/cosmopolitan/blob/master/libc/runtim... We need to rewrite the x86 binary code at runtime in order to support it on Mac/Windows. I managed to speed it up from 30ms down to 1ms of startup latency for python.com!
- IshKebab 4y agoIf I understand it correctly this is only a distribution of Python itself, not third party libraries or user code. So it only solves an insignificant part of Python's distribution issues.