Serdar Yegulalp
Senior Writer

Python-to-C++ compiler promises speedier execution

news analysis
Dec 19, 20142 mins

Nuitka converts Python to C++, which can then be executed or packaged up as a stand-alone file for redistribution

C++ Java PHP .Net Python JavaScript code type input keyboard
Credit: Thinkstock

The more popular the language, the more varied its implementations. Python is a classic example, with most of the replacements for its default interpreter written to speed up execution of the language. Among the latest and most intriguing is Nuika.

Nuika (open source on GitHub) compiles Python to C++ code, which can then be executed in-place or packaged up as a stand-alone file for redistribution. Unlike some other replacements for existing Python interpreters, it claims full compatibility with all the language constructs in Python 2.6, 2.7, 3.2, and 3.3.

According to the project’s lead, Kay Hayen, Nuitka’s first milestone — feature parity with the language — has already been met. Hayen presented a discussion of Nuitka back at the EuroPython 2012 conference and work started in earnest (based on the GitHub commit history) around the end of that year.

To work its magic, Nuitka requires both a current version of the Python interpreter (2.x or 3.x branch) and a C++ compiler. Microsoft Visual Studio, MinGW, and Clang/LLVM are all supported for the latter, in both 32- and 64-bit editions. However, cross-compilation — say, from Linux to Windows or vice-versa — isn’t supported, and compiling a 64-bit executable on Windows requires Microsoft’s compiler.

Another drawback is the creation of stand-alone executables. To do this, Nuitka includes CPython’s redistributables (in Windows, a collection of DLLs and other support files) with the executable. Consequently, stand-alone programs come with a fair amount of overhead: A simple “Hello, world” command-line script for Python 2.7 produces a 2.6MB 32-bit Windows executable, along with 7.4MB of support files. (A GUI version of the same program weighed in at 10MB for the executable, 20MB total.)

Still, what Nuitka can already accomplish is impressive, and Hayen’s plans for its future are ambitious. The next steps are to make the code generated by Nuitka more efficient, including better handling of variable types and optimizations for control flow. Further out on the road map are even more sophisticated and valuable features, such as having Nuitka interface directly with C code used in Python via the language’s ctypes foreign-function system.

Serdar Yegulalp

Serdar Yegulalp is a senior writer at InfoWorld. A veteran technology journalist, Serdar has been writing about computers, operating systems, databases, programming, and other information technology topics for 30 years. Before joining InfoWorld in 2013, Serdar wrote for Windows Magazine, InformationWeek, Byte, and a slew of other publications. At InfoWorld, Serdar has covered software development, devops, containerization, machine learning, and artificial intelligence, winning several B2B journalism awards including a 2024 Neal Award and a 2025 Azbee Award for best instructional content and best how-to article, respectively. He currently focuses on software development tools and technologies and major programming languages including Python, Rust, Go, Zig, and Wasm. Tune into his weekly Dev with Serdar videos for programming tips and techniques and close looks at programming libraries and tools.

More from this author