Re:A function decorator that rewrites the bytecode to enable...
by paiute on Monday September 20, 2021 @11:02PM
(#28601670)
I've been using nuitka. but really it should be part of the language by now.
Re:A function decorator that rewrites the bytecode to enable...
by jitl on Monday September 20, 2021 @09:07PM
(#28600987)
There are a ton of options in Python but none are satisfying compared to eg Golang.
Re:A function decorator that rewrites the bytecode to enable...
by mikepurvis on Monday September 20, 2021 @09:13PM
(#28601023)
Oh sure, a statically-compiled language is always going to win on this for just having it out of the box.
But that can also be seductive in its own way, like when you get used to just deploying a single binary but then suddenly have an application that also includes data files— do you do the go:embed thing to maintain the glorious single binary, or do the pieces go in an archive together? If it's that one, do you find the data at runtime with a flag, or an envvar, or a relative path, or something else?
Undoubtedly, Go is easier than Python or Ruby, especially for the trivial case. But deployment is overall a non-trivial problem.
Re:A function decorator that rewrites the bytecode to enable...
by lmm on Monday September 20, 2021 @09:31PM
(#28601129)
This sounds like a case of perfect being the enemy of good. Yes, no deployment system will cover all cases. But that doesn't mean it's impossible to make a system that's good for most cases.
When I evaluated the landscape a few years ago, I settled on PEX [1] as the solution that happened to fit my use-case the best— it uses a system-provided Python + stdlib, but otherwise brings everything (including compiled modules) with it in a self-extracting executable. Other popular options include pyinstaller and cx_freeze, which have different tradeoffs as far as size, speed, convenience, etc.
[1]: https://github.com/pantsbuild/pex