5 ms·
I've come to realize that putting everything into a container is the only viable way to share a python program. I'll certainly checkout PEX, I think that distr
by rcleveng 2y ago
I've come to realize that putting everything into a container is the only viable way to share a python program.
I'll certainly checkout PEX, I think that distribution of a binary is likely the largest one for Python right now. Java solved it with a JAR file, static-compiled binaries for most compiled languages.
At Google PAR files have been quite a useful way to handle this for at least 18 years now, hope this can get reasonably solved everywhere.
- SoothingSorbet 2y ago> Java solved it with a JAR file JARs still require a JRE to run, and the runtime needs to be invoked. The equivalent would probably be a Python zipapp (which are just Python files zipped into a .pyz the interpreter can run). Static binaries are one advantage that languages like Go and Rust have though, yeah.
- fire_lake 2y agoYou can bundle a JRE with a JAR to get a self contained executable. Also don’t forget that many compiled languages depend on a particular libc so you’re not totally in the clear there.
- 0points 2y agoA JRE + binary deployment weights in over 100 MB. An ordinary compiled binary would be a fraction of that size, saving you time in provisioning and deployment.
- fire_lake 2y agoSmall price to pay if you have a JVM team already. Most programmers (HN is a bubble) hate learning new languages.
- forrestthewoods 2y agoDocker exists because running a Python program is so brutally difficult that packaging up half an OS is the only way to reliably run them.
- drowsspa 2y agoI would say that it's not just a Python problem, Node.js or Ruby seems to have almost the same problems. I'd say Docker exists because packaging C/C++ dependencies is an impossible problem that hasn't been solved in 5 decades. The build tools absolutely suck.
- sitkack 2y agoIt isn't just the build tools, Unix as the platform for Worse Is Better, has decided to never solve this problem. Docker solves the problem of a having an under powered broken dynamic linker. Docker should have never been necessary.
- forrestthewoods 2y ago> under powered broken dynamic linker. In your mind what would a good dynamic linker look like?
- forrestthewoods 2y ago> because packaging C/C++ dependencies is an impossible problem that hasn't been solved in 5 decades C/C++ build systems suck. But deploying a C++ program is much much easier than Python. And Linux is waaaay worse than Windows for both building and deploying imho.