This is to inform you about the new stable release of Nuitka. This time again many organisational improvements, some bug fixes, much improved compatibility and cleanups.
Please see the page “What is Nuitka?” for clarification of what it is now and what it wants to be.
This release cycle had a focus on packaging Nuitka for easier consumption, i.e. automatic packaging, making automatic uploads, improvement documentation, and generally cleaning things up, so that Nuitka becomes more compatible and ultimately capable to run the “hg” test suite. It’s not there yet, but this is a huge jump for usability of Nuitka and its compatibility, again.
Then lots of changes that make Nuitka approach Python3 support, the generated C++ for at least one large example is compiling with this new release. It won’t link, but there will be later releases.
And there is a lot of cleanup going on, geared towards compatibility with line numbers in the frame object.
Bug fixes
- The main module was using “__main__” in tracebacks, but it should be “<module>”. Released as 0.3.14a hotfix already.
- Workaround for “execfile cannot be used as an expression”. It wasn’t possible to use “execfile” in an expression, only as a statement. But then there is crazy enough code in e.g. mercurial that uses it in a lambda function, which made the issue more prominent. The fix now allows it to be an expression, except on the class level, which wasn’t seen yet.
- The inline copy of Scons was not complete enough to work for “Windows” or with “–windows-target” for cross compile. Fixed.
- Cached frames didn’t release the “back” frame, therefore holding variables of these longer than CPython does, which could cause ordering problems. Fixed for increased compatibility.
- Handle “yield outside of function” syntax error in compiled source correctly. This one was giving a Nuitka backtrace, now it gives a “SyntaxError” as it should.
- Made syntax/indentation error output absolutely identical to CPython.
- Using the frame objects “f_lineno” may fix endless amounts bugs related to traceback line numbers.
New Features
- Guesses the location of the MinGW compiler under Windows to default location, so it need not be added to “PATH” environment variable. Removes the need to modify “PATH” environment just for Nuitka to find it.
- Added support for “lambda generators”. You don’t want to know what it is. Lets just say, it was the last absurd language feature out there, that didn’t work. It now works perfect.
Organizational
- You can now download a Windows installer and a Debian package that works on Debian Testing, current Ubuntu and Mint Linux.
- New release scripts give us the ability to have hotfix releases as download packages immediately. That means the “git flow” makes even more beneficial to the users.
- Including the generated “README.pdf” in the distribution archives, so it can be read instead of “README.txt”. The text file is fairly readable, due to the use of ReStructured Text, but the PDF is even nicer to read, due to e.g. syntax highlighting of the examples.
- Renamed the main binaries to “nuitka” and “nuitka-python”, so that there is no dependency on case sensitive file systems.
- For Windows there are batch files “nuitka.bat” and “nuitka-python.bat” to make Nuitka directly executable without finding the “Python.exe”, which the batch files can tell from their own location.
- There are now man pages of “nuitka” and “nuitka-python” with examples for the most common use cases. They are of course included in the Debian package.
- Don’t strip the binary when executing “benchmark.sh” to analyse compiled binary with “valgrind”. It will give better information that way, without changing the code.
Optimizations
- Implemented “swapcontext” alike (“swapFiber”) for x64 to achieve 8 times speedup for Generators. It doesn’t do useless syscalls to preserve signal masks. Now Nuitka is faster at frame switching than CPython on x64, which is already good by design.
Cleanups
- Using the frame objects to store current line of execution avoids the need to store it away in helper code at all. It ought to also help a lot with threading support, and makes Nuitka even more compatible, because now line numbers will be correct even outside tracebacks, but for mere stack frame dumps.
- Moved the “for_return” detection from code generation to tree building where it belongs. Yield statements used as return statements need slightly different code for Python2.6 difference. That solved an old TODO.
- Much Python3 portability work. Sometimes even improving existing code, the Python compiler code had picked up a few points, where the latest Nuitka didn’t work with Python3 anymore, when put to actual compile. The test covered only syntax, but e.g. metaclasses need different code in CPython3, and that’s now supported. Also helper code was made portable in more places, but not yet fully. This will need more work.
- Cleaned up uses of debug defines, so they are now more consistent and in one place.
- Some more PyLint cleanups.
New Tests
- The tests are now executed by Python scripts and cover “stderr” output too. Before we only checked “stdout”. This unveiled a bunch of issues Nuitka had, but went unnoticed so far, and triggered e.g. the frame line number improvements.
- Separate syntax tests.
- The scripts to run the tests now are all in pure Python. This means, no more MinGW shell is needed to execute the tests.
Numbers
There are no new numbers. Nuitka should be as fast as it was, 258% speedup:
python 2.6:
Pystone(1.1) time for 50000 passes = 0.48 This machine benchmarks at 104167 pystones/second
Nuitka 0.3.11 (driven by python 2.6):
Pystone(1.1) time for 50000 passes = 0.19 This machine benchmarks at 263158 pystones/second
Summary
The Debian package, Windows installer, etc. are now automatically updated and uploaded. From here on, there can be such packages for the hotfix releases too.
The exception tracebacks are now correct by design, and better covered.
The generator performance work showed that the approach taken by Nuitka is in fact fast. It was fast on ARM already, but it’s nice to see that it’s now fast on x64. Programs using generators will be affected a lot by this.
Overall, this release brings Nuitka closer to usability. Better binary names, man pages, improved documentation, issue tracker, etc. all there now. I am in fact now looking for a sponsor for the Debian package to upload it into Debian directly.
What’s missing is more “hg” completeness. The frame release issue helped it, but “inspect.getargs()” doesn’t work yet, and is a topic for a future release. Won’t be easy, as “func_defaults” will be an invasive change too.
But I feel now certain, that the milestone “compatibility” may reach that level “compiled hg passes all tests” soonish. Then the focus will turn towards performance. Nuitka will then too compatible too believe, a good base.
As always you will find its latest version here.
Yours,
Kay Hayen




