5 ms·
IMHO, this is a very important project as it makes up for one of the biggest shortcomings in the Python ecosystem - distribution of software. Distribution is cl
by objectified 11y ago
IMHO, this is a very important project as it makes up for one of the biggest shortcomings in the Python ecosystem - distribution of software. Distribution is clearly one of the reasons that Go is so popular. It would be great if we could take advantage of Python as a language and Python as an ecosystem while still being able to deploy as if it was a walk in the park.
- fulafel 11y agoLast time I needed single-executable distribution with Python (admittedly a while ago), there were easy to use "freeze" tools for this that worked really well. A cursory web search suggests that cx_Freeze is the current popular tool for it. Has the situation tehnically deteriorated or are people unaware of these Python tools now?
- Loic 11y agoPyInstaller[0] is working really well. I am using it to deliver Python application in big companies setup as a single ".exe" without the need to install anything on the target machine. The only drawback is that you have the decompression time when starting the software, but in my case, the customers have not noticed it yet. Edit: The advantages of Nuitka are that as you compile your code to C++, you make it faster and also protect it against easy reverse engineering. This could be interesting to compile the critical parts of your application with Nuitka and pack the rest with PyInstaller. [0]: http://www.pyinstaller.org/ http://www.pyinstaller.org/
- scarygliders 11y agocx_Freeze is still very effective for distribution - I use it all the time to produce a standalone version of my software and then I use Inno Setup to create an installer package for my customers. As Loic states, Nuitka works differently from cx_Freeze in that Nuitka takes your Python source, compiles that to C++, then compiles the C++, whereas cx_Freeeze creates Python bytecode which is subsequently run by the included Python interpreter. The result should be that the same Python code should run much faster in the form created by Nuitka, than the result created by cx_Freeze.
- falcolas 11y ago> The result should be that the same Python code should run much faster in the form created by Nuitka How do you figure? Python's slowness is not due to it's lack of compilation, it's due to its dynamic nature and all of the runtime lookups. Past efforts to compile python down to bytecode have not resulted in speedups. Unladen Swallow is one such failed example. PyPy gets around this by analyzing the actual running code and is only able to speed up a subset of all of Python.
- Lofkin 11y agoNuitka is already faster than Cpython and it seems a majority of the speed work has yet to be done.
- scarygliders 11y agoI think you misunderstand what Nuitka is doing... It is not compiling down to Python bytecode. It is compiling to an operational-equivalent C++ source code. Then it is compiling that C++ code to executable object code.
- rwmj 11y agoI find the way software is packaged in Go to be a terrible regression, but I'm more interested in why you think pip and venv's don't solve the problem for Python already? Edit: I see from your reply that we're talking at cross purposes. I thought you meant source distribution, but you mean binary distribution to end users or deployment to production systems, and in that case I agree with you.
- objectified 11y agoBeing able to ship a self contained binary of your application is a very powerful concept, on which many seem to agree. The way I see it, pip and virtualenv are not practical for deployment or distribution. You shouldn't have to download and install things during a production deployment. I even created a tool (https://github.com/objectified/vdist https://github.com/objectified/vdist) to mitigate this problem, but it will always be a hack when doing it this way.
- _yy 11y agoRemember that critical Go security update? Usual procedure - update the shared library, restart affected services. Go - recompile everything.
- falcolas 11y ago> update the shared library, restart affected services ... look for programs to break at runtime because of some unrelated API change in the shared library.
- _yy 11y agoThat's why Debian Stable and RHEL exist. Security patches don't break the API.
- falcolas 11y ago> Security patches don't break the API. shouldn't When the patched library is not part of Debian Stable or RHEL's repositories (for example, if you require features from a release less than a year old) all bets of API stability are off. OpenSSL and libc are not the only libraries which are patched for security that people use.
- pjmlp 11y ago> Distribution is clearly one of the reasons that Go is so popular. By those that never used an AOT compiler to native code. Other than that, Given that Lisp, Dylan always had AOT compilers, it would be nice if Python eventually had something similar.
- sametmax 11y ago+1. I'll donate to the guy and if you are using Python professionally, you should consider doing so, and inviting your compagny to follow.