News for hackers. Stuff that matters.
Re:Pex: A tool for generating .pex (Python EXecutable) files... by rcleveng on Friday November 15, 2024 @05:43PM (#42152113)
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.

Re:Pex: A tool for generating .pex (Python EXecutable) files... by SoothingSorbet on Saturday November 16, 2024 @02:05AM (#42154970)
> 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.

Re:Pex: A tool for generating .pex (Python EXecutable) files... by fire_lake on Saturday November 16, 2024 @03:51AM (#42155341)
You 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.

Re:Pex: A tool for generating .pex (Python EXecutable) files... by 0points on Saturday November 16, 2024 @08:41AM (#42156349)
A 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.

Re:Pex: A tool for generating .pex (Python EXecutable) files... by fire_lake on Saturday November 16, 2024 @12:52PM (#42157760)
Small price to pay if you have a JVM team already.

Most programmers (HN is a bubble) hate learning new languages.

Re:Pex: A tool for generating .pex (Python EXecutable) files... by forrestthewoods on Saturday November 16, 2024 @03:09AM (#42155194)
Docker exists because running a Python program is so brutally difficult that packaging up half an OS is the only way to reliably run them.
Re:Pex: A tool for generating .pex (Python EXecutable) files... by drowsspa on Saturday November 16, 2024 @11:53AM (#42157376)
I 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.
Re:Pex: A tool for generating .pex (Python EXecutable) files... by sitkack on Saturday November 16, 2024 @01:14PM (#42157950)
It 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.

Re:Pex: A tool for generating .pex (Python EXecutable) files... by forrestthewoods on Saturday November 16, 2024 @05:18PM (#42159871)
> under powered broken dynamic linker.

In your mind what would a good dynamic linker look like?

Re:Pex: A tool for generating .pex (Python EXecutable) files... by forrestthewoods on Saturday November 16, 2024 @01:23PM (#42158040)
> 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.