Hacker News new | past | comments | ask | show | jobs | submit login

How does this compare to pyinstaller or nuitika?




Nuitka compiles Python to C, so it can make your code run faster, but you're no longer using the tried and tested CPython interpreter so you may run into Nuitka-specific issues (I haven't used it and don't know how common they are, I assume it's usable though)

PyOxidizer and pyinstaller are rather bundlers that build a CPython interpreter and all your dependencies into a single binary. There is also https://github.com/pantsbuild/pex which is a bit like jar files for Java, but it also bundles your code, dependencies and an interpreter into a single executable file.


Nuitka compiles Python to C using the Python C-library (something Cython is also capable of), with a focus on portability. Nuitkas main goal is not speed (compared to Cython), but the ability to output an executable binary (plus a bunch of dynamic libraries) needed to run your program in a portable, "interpreter independent" way. From the "What is Nuitka" page[0]:

> It translates the Python into a C program that then is linked against libpython to execute in the same way as CPython does, in a very compatible way.

Once they managed full compatibility (I think it was in 0.4?) then they started to focus on optimizing and translating even more things to C (again, keeping compatibility at 100% -- so you shouldn't event run into Nuitka-specific issues).

I've used it to deploy a few custom triage programs in the field for DFIR operations where we'd want to run a few specific things from portable drives without installing anything in the triaged computer.

[0] http://nuitka.net/pages/overview.html


Nuitka is great! I use it to compile some of the command line tools which I have written. Command lines tools compiled with Nuitka have a much better startup time.

Nuitka also has a single file binary target in the works.

Compiled single file binaries for python. Wohoo!


Single file binaries would be great for my use case! It all works fine now, but the instructions would go from "copy all this directory with everything inside, MAKE SURE EVERY FILE IS COPIED, then make sure again" to "copy the file".


Nuitka uses libpython, which is CPython, not some random Nuitka-specific interpreter.


I don't think it's that simple

Nuitka-specific issues are real: https://github.com/Nuitka/Nuitka/issues

My comments aren't meant as a criticism of Nuitka though, I am very glad to see this project existing.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: