All Versions
91
Latest Version
Avg Release Cycle
54 days
Latest Release
1444 days ago

Changelog History
Page 8

  • v0.3.13 Changes

    ๐Ÿš€ This release is mostly the result of working towards compilation of a real ๐Ÿ”€ programs (Mercurial) and to merge and finalize the frame stack work. Now Nuitka ๐Ÿ‘ has a correct frame stack at all times, and supports func_code and gi_code objects, something previously thought to be impossible.

    Actually now it's only the "bytecode" objects that won't be there. And not ๐Ÿ‘ attributes of func_code are meaningful yet, but in theory can be supported.

    Due to the use of the "git flow" for Nuitka, most of the bugs listed here were ๐Ÿš€ already fixed in on the stable release before this release. This time there ๐Ÿš€ were 5 such hot fix releases, sometimes fixing multiple bugs.

    ๐Ÿ› Bug fixes

    • ๐Ÿ‘ป In case of syntax errors in the main program, an exception stack was giving that included Nuitka code. Changed to make the same output as CPython does. Fixed in 0.3.12a already.

    • The star import (from x import *) didn't work for submodules. Providing * as the import list to the respective code allowed to drop the complex lookups we were doing before, and to simply trust CPython C/API to do it correctly. Fixed in 0.3.12 already.

    • The absolute import is not the default of CPython 2.7 it seems. A local posix package shadows the standard library one. Fixed in 0.3.12 already.

    • In --deep mode, a module may contain a syntax error. This is e.g. true of "PyQt" with port_v3 included. These files contain Python3 syntax and fail to be imported in Python2, but that is not to be considered an error. These modules are now skipped with a warning. Fixed in 0.3.12b already.

    • The code to import modules wasn't using the __import__ built-in, which prevented __import__ overriding code to work. Changed import to use the built-in. Fixed in 0.3.12c already.

    • The code generated for the __import__ built-in with constant values was doing relative imports only. It needs to attempt relative and absolute imports. Fixed in 0.3.12c already.

    • The code of packages in "init.py" believed it was outside of the package, giving problems for package local imports. Fixed in 0.3.12d already.

    • It appears that "Scons", which Nuitka uses internally and transparent to you, to execute the compilation and linking tasks, was sometimes not building the binaries or shared libraries, due to a false caching. As a workaround, these are now erased before doing the build. Fixed in 0.3.12d already.

    • The use of in and not in in comparison chains (e.g. a < b < c is one), wasn't supported yet. The use of these in comparison chains a in b in c is very strange.

    Only in the test_grammar.py it was ever used I believe. Anyway, it's supported now, solving this TODO and reducing the difference. Fixed in 0.3.12e already.

    • The order of evaluation for in and not in operators wasn't enforced in a portable way. Now it is correct on "ARM" too. Fixed in 0.3.12e already.

    ๐Ÿ†• New Optimization

    • โšก๏ธ The built-ins GeneratorExit and StopIteration are optimized to their Python C/API names where possible as well.

    Cleanups

    • The __file__ attribute of modules was the relative filename, but for absolute filenames these become a horrible mess at least on Linux.

    • โž• Added assertion helpers for sane frame and code objects and use them.

    • ๐Ÿ‘‰ Make use of assertObject in more places.

    • Instead of using os.path.sep all over, added a helper Utils.joinpath that hides this and using os.path.join. This gives more readable code.

    • โž• Added traces to the "unfreezer" guarded by a define. Helpful in analyzing import problems.

    • ๐Ÿ‘• Some PyLint cleanups removing dead code, unused variables, useless pass statement, etc.

    ๐Ÿ†• New Tests

    • ๐Ÿ†• New tests to cover SyntaxError and IndentationError from --deep imports and in main program.

    • ๐Ÿ†• New test to cover evaluation order of in and not in comparisons.

    • New test to cover package local imports made by the "init.py" of the package.

    Organizational

    • Drop "compile_itself.sh" in favor of the new "compile_itself.py", because the later is more portable.

    • ๐ŸŒฒ The logging output is now nicer, and for failed recursions, outputs the line that is having the problem.

    Summary

    The frame stack work and the func_code are big for compatibility.

    The func_code was also needed for "hg" to work. For Mercurial to pass all โœ… of its test suite, more work will be needed, esp. the inspect module needs to be run-time patched to accept compiled functions and generators too.

    Once real world programs like Mercurial work, we can use these as more meaningful benchmarks and resume work on optimization.

  • v0.3.12 Changes

    ๐Ÿš€ This is to inform you about the new release of Nuitka many bug fixes, and substantial improvements especially in the organizational area. There is a new "User Manual <http://nuitka.net/doc/user-manual.html>" (PDF <http://nuitka.net/doc/user-manual.pdf>), with much improved content, a sys.meta_path based import mechanism for --deep mode, git flow goodness.

    ๐Ÿš€ This release is generally also the result of working towards compilation of a ๐Ÿ real programs (Mercurial) and to get things work more nicely on Windows by 0๏ธโƒฃ default. Thanks go to Liu Zhenhai for helping me with this goal.

    Due to the use of the "git flow", most of the bugs listed here were already ๐Ÿ›  fixed in on the stable release before this release. And there were many of these.

    ๐Ÿ› Bug fixes

    • The order of evaluation for base classes and class dictionaries was not enforced.

    Apparently nothing in the CPython test suite did that, I only noticed during debugging that Nuitka gave a different error than CPython did, for a class that had an undefined base class, because both class body and base classes were giving an error. Fixed in 0.3.11a already.

    • Method objects didn't hold a reference to the used class.

    The effect was only noticed when --python-debug was used, i.e. the debug version of Python linked, because then the garbage collector makes searches. Fixed in 0.3.11b already.

    • ๐Ÿง Set sys.executable on Linux as well. On Debian it is otherwise /usr/bin/python which might be a different version of Python entirely. Fixed in 0.3.11c already.

    • ๐Ÿ“ฆ Embedded modules inside a package could hide package variables of the same name. Learned during PyCON DE about this corner case. Fixed in 0.3.11d already.

    • ๐Ÿ“ฆ Packages could be duplicated internally. This had no effect on generated code other than appearing twice in the list if frozen modules. Fixed in 0.3.11d already.

    • When embedding modules from outside current directory, the look-up failed. The embedding only ever worked for the compile itself and programs test cases, because they are all in the current directory then. Fixed in 0.3.11e already.

    • ๐Ÿ The check for ARM target broke Windows support in the Scons file. Fixed in 0.3.11f already.

    • The star import from external modules failed with an error in --deep mode. Fixed in 0.3.11g already.

    • ๐Ÿ“ฆ Modules with a parent package could cause a problem under some circumstances. Fixed in 0.3.11h already.

    • One call variant, with both list and dict star arguments and keyword arguments, but no positional parameters, didn't have the required C++ helper function implemented. Fixed in 0.3.11h already.

    • The detection of the CPU core count was broken on my hexacore at least. Gave 36 instead of 6, which is a problem for large programs. Fixed in 0.3.11h already.

    • ๐Ÿ The in-line copy of Scons didn't really work on Windows, which was sad, because we added it to simplify installation on Windows precisely because of this.

    • ๐Ÿ— Cleaning up the build directory from old sources and object files wasn't portable to Windows and therefore wasn't effective there.

    • From imports where part of the imported were found modules and parts were not, didn't work. Solved by the feature branch meta_path_import that was merged for this release.

    • ๐Ÿ†• Newer MinGW gave warnings about the default visibility not being possible to apply to class members. Fixed by not setting this default visibility anymore on Windows.

    • ๐Ÿ The sys.executable gave warnings on Windows because of backslashes in the path. Using a raw string to prevent such problems.

    • The standard library path was hard coded. Changed to run time detection.

    Cleanups

    • ๐Ÿ”– Version checks on Python runtime now use a new define PYTHON_VERSION that makes it easier. I don't like PY_VERSION_HEX, because it is so unreadable. Makes some of the checks a lot more safe.

    • The sys.meta_path based import from the meta_path_import feature branch allowed the cleanup the way importing is done. It's a lot less code now.

    • โœ‚ Removed some unused code. We will aim at making Nuitka the tool to detect dead code really.

    • ๐Ÿ“ฆ Moved nuitka.Nodes to nuitka.nodes.Nodes, that is what the package is intended for, the split will come later.

    ๐Ÿ†• New Tests

    • ๐Ÿ†• New tests for import variants that previously didn't work: Mixed imports. Imports from a package one level up. Modules hidden by a package variable, etc.

    • โž• Added test of function call variant that had no test previously. Only found it when compiling "hg". Amazing how nothing in my tests, CPython tests, etc. used it.

    • โž• Added test to cover the partial success of import statements.

    • โž• Added test to cover evaluation order of class definitions.

    Organizational

    • Migrated the "README.txt" from org-mode to ReStructured Text, which allows for a more readable document, and to generate a nice "User Manual <http://nuitka.net/doc/user-manual.html>__" in PDF form.

    • The amount of information in "README.txt" was increased, with many more subjects are now covered, e.g. "git flow" and how to join Nuitka development. It's also impressive to see what code blocks and syntax highlighting can do for readability.

    • ๐Ÿ‘€ The Nuitka git repository has seen multiple hot fixes.

    These allowed to publish bug fixes immediately after they were made, and avoided the need for a new release just to get these out. This really saves me a lot of time too, because I can postpone releasing the new version until it makes sense because of other things.

    • Then there was a feature branch meta_path_import that lived until being merged to develop to improve the import code, which is now released on master as stable. Getting that feature right took a while.

    • And there is the feature branch minimize_CPython26_tests_diff which has some success already in documenting the required changes to the "CPython26" test suite and in reducing the amount of differences, while doing it. We have a frame stack working there, albeit in too ugly code form.

    • ๐Ÿš€ The release archives are now built using setuptools. You can now also download a zip file, which is probably more Windows friendly. The intention is to work on that to make setup.py produce a Nuitka install that won't rely on any environment variables at all. Right now setup.py won't even allow any other options than sdist to be given.

    • Ported "compile_itself.sh" to "compile_itself.py", i.e. ported it to Python. This way, we can execute it easily on Windows too, where it currently still fails. Replacing diff, rm -rf, etc. is a challenge, but it reduces the dependency on MSYS tools on Windows.

    • 0๏ธโƒฃ The compilation of standard library is disabled by default, but site or dist packages are now embedded. To include even standard library, there is a --really-deep option that has to be given in addition to --deep, which forces this.

    Summary

    Again, huge progress. The improved import mechanism is very beautiful. It appears that little is missing to compile real world programs like "hg" with ๐Ÿš€ Nuitka. The next release cycle will focus on that and continue to improve the ๐Ÿ Windows support which appears to have some issues.

  • v0.3.11 Changes

    ๐Ÿš€ This is to inform you about the new release of Nuitka with some bug fixes and portability work.

    ๐Ÿš€ This release is generally cleaning up things, and makes Nuitka portable to ARM ๐Ÿง Linux. I used to host the Nuitka homepage on that machine, but now that it's no ๐Ÿ‘ท longer so, I can run heavy compile jobs on it. To my surprise, it found many portability problems. So I chose to fix that first, the result being that ๐Ÿง Nuitka now works on ARM Linux too.

    ๐Ÿ› Bug fixes

    • The order of slice expressions was not correct on x86 as well, and I found that with new tests only. So the porting to ARM revealed a bug category, I previously didn't consider.

    • ๐Ÿง The use of linux2 in the Scons file is potentially incompatible with Linux 3.0, although it seems that at least on Debian the sys.platform was changed back to linux2. Anyway, it's probably best to allow just anything that starts with linux these days.

    • ๐Ÿ–จ The print statement worked like a print function, i.e. it first evaluated all printed expressions, and did the output only then. That is incompatible in case of exceptions, where partial outputs need to be done, and so that got fixed.

    ๐Ÿ†• New Optimization

    • Function calls now each have a dedicated helper function, avoiding in some cases unnecessary work. We will may build further on this and in-line PyObject_Call differently for the special cases.

    Cleanups

    • ๐Ÿšš Moved many C++ helper declarations and in-line implementations to dedicated header files for better organisation.

    • ๐Ÿšš Some dependencies were removed and consolidated to make the dependency graph sane.

    • Multiple decorators were in reverse order in the node tree. The code generation reversed it back, so no bug, yet that was a distorted tree.

    Finding this came from the ARM work, because the "reversal" was in fact just the argument evaluation order of C++ under x86/x64, but on ARM that broke. Correcting it highlighted this issue.

    • The deletion of slices, was not using Py_ssize for indexes, disallowing some kinds of optimization, so that was harmonized.

    • The function call code generation got a general overhaul. It is now more consistent, has more helpers available, and creates more readable code.

    • ๐Ÿ‘• PyLint is again happier than ever.

    ๐Ÿ†• New Tests

    • โœ… There is a new basic test OrderChecks that covers the order of expression evaluation. These problems were otherwise very hard to detect, and in some cases not previously covered at all.

    • Executing Nuitka with Python3 (it won't produce correct Python3 C/API code) is now part of the release tests, so non-portable code of Nuitka gets caught.

    Organizational

    • ๐Ÿ‘Œ Support for ARM Linux. I will make a separate posting on the challenges of this. Suffice to say now, that C++ leaves way too much things unspecified.

    • The Nuitka git repository now uses "git flow". The new git policy will be detailed in another separate posting <http://nuitka.net/posts/nuitka-git-flow.html>__.

    • There is an unstable develop branch in which the development occurs. For this release ca. 40 commits were done to this branch, before merging it. I am also doing more fine grained commits now.

    • ๐Ÿš€ Unlike previously, there is master branch for the stable release.

    • โšก๏ธ There is a script "make-dependency-graph.sh" (Update: meanwhile it was renamed to "make-dependency-graph.py") to produce a dependency graphs of Nuitka. I detected a couple of strange things through this.

    • The Python3 __pycache__ directories get removed too by the cleanup script.

    Numbers

    We only have "PyStone" now, and on a new machine, so the numbers cannot be ๐Ÿš€ compared to previous releases:

    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

    So this a speedup factor of 258%, last time on another machine it was 240%. Yet it only proves that the generated and compiled are more efficient than bytecode, but Nuitka doesn't yet do the relevant optimization. Only once it does, the factor will be significantly higher.

    Summary

    Overall, there is quite some progress. Nuitka is a lot cleaner now, which will ๐Ÿ›  help us later only. I wanted to get this out, mostly because of the bug fixes, and of course just in case somebody attempts to use it on ARM.

  • v0.3.10 Changes

    ๐Ÿš€ This new release is major milestone 2 work, enhancing practically all areas of Nuitka. The focus was roundup and breaking new grounds with structural optimization enhancements.

    ๐Ÿ› Bug fixes

    • Exceptions now correctly stack.

    When you catch an exception, there always was the exception set, but calling a new function, and it catching the exception, the values of sys.exc_info() didn't get reset after the function returned.

    This was a small difference (of which there are nearly none left now) but one that might effect existing code, which affects code that calls functions in exception handling to check something about it.

    So it's good this is resolved now too. Also because it is difficult to understand, and now it's just like CPython behaves, which means that we don't have to document anything at all about it.

    • ๐Ÿ›  Using exec in generator functions got fixed up. I realized that this wouldn't work while working on other things. It's obscure yes, but it ought to work.

    • Lambda generator functions can now be nested and in generator functions. There were some problems here with the allocation of closure variables that got resolved.

    • List contractions could not be returned by lambda functions. Also a closure issue.

    • When using a mapping for globals to exec or eval that had a side effect on lookup, it was evident that the lookup was made twice. Correcting this also improves the performance for the normal case.

    ๐Ÿ†• New Optimization

    • Statically raised as well as predicted exceptions are propagated upwards, leading to code and block removal where possible, while maintaining the side effects.

    This is brand new and doesn't do everything possible yet. Most notable, the matching of raised exception to handlers is not yet performed.

    • ๐Ÿ‘ป Built-in exception name references and creation of instances of them are now optimized as well, which leads to faster exception raising/catching for these cases.

    • More kinds of calls to built-ins are handled, positional parameters are checked and more built-ins are covered.

    Notable is that now checks are performed if you didn't potentially overload e.g. the len with your own version in the module. Locally it was always detected already. So it's now also safe.

    • All operations and comparisons are now simulated if possible and replaced with their result.

    • In the case of predictable true or false conditions, not taken branches are removed.

    • ๐Ÿšš Empty branches are now removed from most constructs, leading to sometimes cleaner code generated.

    Cleanups

    • โœ‚ Removed the lambda body node and replaced it with function body. This is a great win for the split into body and builder. Regular functions and lambda functions now only differ in how the created body is used.

    • Large cleanup of the operation/comparison code. There is now only use of a simulator function, which exists for every operator and comparison. This one is then used in a prediction call, shared with the built-in predictions.

    • โž• Added a Tracing module to avoid future imports of print_function, which annoyed me many times by causing syntax failures for when I quickly added a print statement, not noting it must have the braces.

    • ๐Ÿ‘• PyLint is happier than ever.

    ๐Ÿ†• New Tests

    • โœจ Enhanced OverflowFunctions test to cover even deeper nesting of overflow functions taking closure from each level. While it's not yet working, this makes clearer what will be needed. Even if this code is obscure, I would like to be that correct here.

    • โœ… Made Operators test to cover the `` operator as well.

    • โž• Added to ListContractions the case where a contraction is returned by a lambda function, but still needs to leak its loop variable.

    • โœจ Enhanced GeneratorExpressions test to cover lambda generators, which is really crazy code:

    .. code-block:: python

     def y():
         yield((yield 1),(yield 2))
    
    • โž• Added to ExecEval a case where the exec is inside a generator, to cover that too.

    • โœ… Activated the testing of sys.exc_info() in ExceptionRaising test.

    This was previously commented out, and now I added stuff to illustrate all of the behavior of CPython there.

    • โœจ Enhanced ComparisonChains test to demonstrate that the order of evaluations is done right and that side effects are maintained.

    • โž• Added BuiltinOverload test to show that overloaded built-ins are actually called and not the optimized version. So code like this has to print 2 lines:

    .. code-block:: python

     from __builtin__ import len as _len
    
     def len(x):
        print x
    
     return _len(x)
    
     print len(range(9))
    

    Organizational

    • ๐Ÿ”„ Changed "README.txt" to no longer say that "Scons" is a requirement. Now that it's included (patched up to work with ctypes on Windows), we don't have to say that anymore.

    • Documented the status of optimization and added some more ideas.

    • There is now an option to dump the node tree after optimization as XML. Not currently use, but is for regression testing, to identify where new optimization and changes have an impact. This make it more feasible to be sure that Nuitka is only becoming better.

    • Executable with Python3 again, although it won't do anything, the necessary code changes were done.

    Summary

    ๐Ÿ‘€ It's nice to see, that I some long standing issues were resolved, and that structural optimization has become almost a reality.

    ๐Ÿ‘ป The difficult parts of exception propagation are all in place, now it's only details. With that we can eliminate and predict even more of the stupid code of "pybench" at compile time, achieving more infinite speedups.

  • v0.3.9 Changes

    ๐Ÿš€ This is about the new release of Nuitka which some bug fixes and offers a good speed improvement.

    ๐Ÿš€ This new release is major milestone 2 work, enhancing practically all areas of Nuitka. The main focus was on faster function calls, faster class attributes (not instance), faster unpacking, and more built-ins detected and more โšก๏ธ thoroughly optimizing them.

    ๐Ÿ› Bug fixes

    • ๐Ÿ‘ป Exceptions raised inside with statements had references to the exception and traceback leaked.

    • ๐Ÿ On Windows the binaries sys.executable pointed to the binary itself instead of the Python interpreter. Changed, because some code uses sys.executable to know how to start Python scripts.

    • ๐Ÿ›  There is a bug (fixed in their repository) related to C++ raw strings and C++ "trigraphs" that affects Nuitka, added a workaround that makes Nuitka not emit "trigraphs" at all.

    • The check for mutable constants was erroneous for tuples, which could lead to assuming a tuple with only mutable elements to be not mutable, which is of course wrong.

    ๐Ÿ†• New Optimization

    This time there are so many new optimization, it makes sense to group them by the subject.

    Exceptions

    
    - The code to add a traceback is now our own, which made it possible to use
      frames that do not contain line numbers and a code object capable of lookups.
    
    - Raising exceptions or adding to tracebacks has been made way faster by
      reusing a cached frame objects for the task.
    
    - The class used for saving exceptions temporarily (e.g. used in
      ``try``/``finally`` code, or with statement) has been improved.
    
      It now doesn't make a copy of the exception with a C++ ``new`` call, but it
      simply stores the exception properties itself and creates the exception
      object only on demand, which is more efficient.
    
    - When catching exceptions, the addition of tracebacks is now done without
      exporting and re-importing the exception to Python, but directly on the
      exception objects traceback, this avoids a useless round trip.
    
    Function Calls
    
    • ๐Ÿ‘‰ Uses of PyObject_Call provide NULL as the dictionary, instead of an empty dictionary, which is slightly faster for function calls.

    • There are now dedicated variants for complex function calls with * and ** arguments in all forms.

    These can take advantage of easier cases. For example, a merge with star arguments is only needed if there actually were any of these.

    • The check for non-string values in the ** arguments can now be completely short-cut for the case of a dictionary that has never had a string added. There is now code that detects this case and skips the check, eliminating it as a performance concern.

    ๐Ÿ“œ Parameter Parsing

    
    - Reversed the order in which parameters are checked.
    
      Now the keyword dictionary is iterated first and only then the positional
      arguments after that is done. This iteration is not only much faster
      (avoiding repeated lookups for each possible parameter), it also can be more
      correct, in case the keyword argument is derived from a dictionary and its
      keys mutate it when being compared.
    
    - Comparing parameter names is now done with a fast path, in which the pointer
      values are compare first. This can avoid a call to the comparison at all,
      which has become very likely due to the interning of parameter name strings,
      see below.
    
    - โž• Added a dedicated call to check for parameter equality with rich equality
      comparison, which doesn't raise an exception.
    
    - Unpacking of tuples is now using dedicated variants of the normal unpacking
      code instead of rolling out everything themselves.
    
    Attribute Access
    ~~~~~~~~~~~~~~~~
    
    - The class type (in executables, not yet for extension modules) is changed to
      a faster variant of our own making that doesn't consider the restricted mode
      a possibility. This avoids very expensive calls, and makes accessing class
      attributes in compiled code and in non-compiled code faster.
    
    - Access to attributes (but not of instances) got in-lined and therefore much
      faster. Due to other optimization, a specific step to intern the string used
      for attribute access is not necessary with Nuitka at all anymore. This made
      access to attributes about 50% faster which is big of course.
    
    Constants
    ~~~~~~~~~
    
    - The bug for mutable tuples also caused non-mutable tuples to be considered as
      mutable, which lead to less efficient code.
    
    - The constant creation with the g++ bug worked around, can now use raw strings
      to create string constants, without resorting to un-pickling them as a work
      around. This allows us to use ``PyString_FromStringAndSize`` to create
      strings again, which is obviously faster, and had not been done, because of
      the confusion caused by the g++ bug.
    
    - For string constants that are usable as attributes (i.e. match the identifier
      regular expression), these are now interned, directly after creation. With
      this, the check for identical value of pointers for parameters has a bigger
      chance to succeed, and this saves some memory too.
    
    - For empty containers (set, dict, list, tuple) the constants created are now
      are not unstreamed, but created with the dedicated API calls, saving a bit of
      code and being less ugly.
    
    - For mutable empty constant access (set, dict, list) the values are no longer
      made by copying the constant, but instead with the API functions to create
      new ones. This makes code like ``a = []`` a tiny bit faster.
    
    - For slice indices the code generation now takes advantage of creating a C++
      ``Py_ssize_t`` from constant value if possible. Before it was converting the
      integer constant at run time, which was of course wasteful even if not (very)
      slow.
    
    Iteration
    ~~~~~~~~~
    
    - The creation of iterators got our own code. This avoids a function call and
      is otherwise only a small gain for anything but sequence iterators. These may
      be much faster to create now, as it avoids another call and repeated checks.
    
    - The next on iterator got our own code too, which has simpler code flow,
      because it avoids the double check in case of NULL returned.
    
    - The unpack check got similar code to the next iterator, it also has simpler
      code flow now and avoids double checks.
    
    Built-ins
    ~~~~~~~~~
    
    - โž• Added support for the ``list``, ``tuple``, ``dict``, ``str``, ``float`` and
      ``bool`` built-ins along with optimizing their use with constant parameter.
    
    - โž• Added support for the ``int`` and ``long`` built-ins, based on a new "call
      spec" object, that detects parameter errors at compile time and raises
      appropriate exceptions as required, plus it deals with keyword arguments just
      as well.
    
      So, to Nuitka it doesn't matter now it you write ``int(value) ``or ``int(x =
      value)`` anymore. The ``base`` parameter of these built-ins is also
      supported.
    
      The use of this call spec mechanism will the expanded, currently it is not
      applied to the built-ins that take only one parameter. This is a work in
      progress as is the whole built-ins business as not all the built-ins are
      covered yet.
    
    Cleanups
    ~~~~~~~~
    
    - In 0.3.8 per module global classes were introduced, but the ``IMPORT_MODULE``
      kept using the old universal class, this got resolved and the old class is
      now fully gone.
    
    - Using ``assertObject`` in more cases, and in more places at all, catches
      errors earlier on.
    
    - ๐Ÿšš Moved the addition to tracebacks into the ``_PythonException`` class, where
      it works directly on the contained traceback. This is cleaner as it no longer
      requires to export exceptions to Python, just to add a traceback entry.
    
    - ๐Ÿ‘• Some ``PyLint`` cleanups were done, reducing the number of reports a bit, but
      there is still a lot to do.
    
    - โž• Added a ``DefaultValueIdentifier`` class that encapsulates the access to
      default values in the parameter parsing more cleanly.
    
    - The module ``CodeTemplatesListContractions`` was renamed to
      ``CodeTemplatesContractions`` to reflect the fact that it deals with all
      kinds of contractions (also set and dict contractions), not just list
      contractions.
    
    - ๐Ÿšš Moved the with related template to its own module ``CodeTemplatesWith``, so
      its easier to find.
    
    - The options handling for g++ based compilers was cleaned up, so that g++ 4.6
      and MinGW are better supported now.
    
    - ๐Ÿ— Documented more aspects of the Scons build file.
    
    - ๐Ÿ›  Some more generated code white space fixes.
    
    - ๐Ÿšš Moved some helpers to dedicated files. There is now ``calling.hpp`` for
      function calls, an ``importing.cpp`` for import related stuff.
    
    - ๐Ÿšš Moved the manifest generation to the scons file, which now produces ready to
      use executables.
    
    ๐Ÿ†• New Tests
    ---------
    
    - โž• Added a improved version of "pybench" that can cope with the "0 ms" execution
      time that Nuitka has for some if its sub-tests.
    
    - โœ… Reference counting test for with statement was added.
    
    - ๐ŸŽ Micro benchmarks to demonstrate try finally performance when an exception
      travels through it.
    
    - Micro benchmark for with statement that eats up exceptions raised inside the
      block.
    
    - Micro benchmarks for the read and write access to class attributes.
    
    - โœจ Enhanced ``Printing`` test to cover the trigraphs constant bug case. Output
      is required to make the error detectable.
    
    - โœจ Enhanced ``Constants`` test to cover repeated mutation of mutable tuple
      constants, this covers the bug mentioned.
    
    Organizational
    --------------
    
    - โž• Added a credits section to the "README.txt" where I give credit to the people
      who contributed to Nuitka, and the projects it is using. I will make it a
      separate posting to cite these.
    
    - Documented the requirements on the compiler more clearly, document the fact
      that we require scons and which version of Python (2.6 or 2.7).
    
    - The is now a codespeed implementation up and running with historical data for
      up to Nuitka 0.3.8 runs of "PyStone" and with pybench. It will be updated for
      0.3.9 once I have the infrastructure in place to do that automatically.
    
    - ๐Ÿšš The cleanup script now also removes .so files.
    
    - The handling of options for g++ got improved, so it's the same for g++ and
      MinGW compilers, plus adequate errors messages are given, if the compiler
      version is too low.
    
    - There is now a ``--unstriped`` option that just keeps the debug information
      in the file, but doesn't keep the assertions.
    
      This will be helpful when looking at generated assembler code from Nuitka to
      not have the distortions that ``--debug`` causes (reduced optimization level,
      assertions, etc.) and instead a clear view.
    
  • v0.3.8 Changes

    ๐Ÿš€ This is to inform you about the new release of Nuitka with some real news and a ๐ŸŽ slight performance increase. The significant news is added "Windows ๐Ÿ‘Œ Support". You can now hope to run Nuitka on Windows too and have it produce working executables against either the standard Python distribution or a MinGW compiled Python.

    ๐Ÿ“š There are still some small things to iron out, and clearly documentation needs to be created, and esp. the DLL hell problem of msvcr90.dll vs. msvcrt.dll, is not yet fully resolved, but appears to be not as harmful, at ๐Ÿ least not on native Windows.

    ๐Ÿ‘€ I am thanking Khalid Abu Bakr for making this possible. I was surprised to see this happen. I clearly didn't make it easy. He found a good way around ucontext, identifier clashes, and a very tricky symbol problems where the ๐Ÿง CPython library under Windows exports less than under Linux. Thanks a whole lot.

    ๐Ÿ Currently the Windows support is considered experimental and works with MinGW 4.5 or higher only.

    ๐ŸŽ Otherwise there have been the usual round of performance improvements and more ๐Ÿš€ cleanups. This release is otherwise milestone 2 work only, which will have to continue for some time more.

    ๐Ÿ› Bug fixes

    • Lambda generators were not fully compatible, their simple form could yield an extra value. The behavior for Python 2.6 and 2.7 is also different and Nuitka now mimics both correctly, depending on the used Python version

    • The given parameter count cited in the error message in case of too many parameters, didn't include the given keyword parameters in the error message.

    • โš  There was an assert False right after warning about not found modules in the --deep mode, which was of course unnecessary.

    ๐Ÿ†• New Optimization

    • When unpacking variables in assignments, the temporary variables are now held in a new temporary class that is designed for the task specifically.

    This avoids the taking of a reference just because the PyObjectTemporary destructor insisted on releasing one. The new class PyObjectTempHolder hands the existing reference over and releases only in case of exceptions.

    • When unpacking variable in for loops, the value from the iterator may be directly assigned, if it's to a variable.

    In general this would be possible for every assignment target that cannot raise, but the infrastructure cannot tell yet, which these would be. This will improve with more milestone 3 work.

    • ๐Ÿšš Branches with only pass inside are removed, pass statements are removed before the code generation stage. This makes it easier to achieve and decide empty branches.

    • There is now a global variable class per module. It appears that it is indeed faster to roll out a class per module accessing the module * rather than having one class and use a module **, which is quite disappointing from the C++ compiler.

    • Also MAKE_LIST and MAKE_TUPLE have gained special cases for the 0 arguments case. Even when the size of the variadic template parameters should be known to the compiler, it seems, it wasn't eliminating the branch, so this was a speedup measured with valgrind.

    • Empty tried branches are now replaced when possible with try/except statements, try/finally is simplified in this case. This gives a cleaner tree structure and less verbose C++ code which the compiler threw away, but was strange to have in the first place.

    • In conditions the or and and were evaluated with Python objects instead of with C++ bool, which was unnecessary overhead.

    • List contractions got more clever in how they assign from the iterator value.

    It now uses a PyObjectTemporary if it's assigned to multiple values, a PyObjectTempHolder if it's only assigned once, to something that could raise, or a PyObject * if an exception cannot be raised. This avoids temporary references completely for the common case.

    Cleanups

    • The if, for, and while statements had always empty else nodes which were then also in the generated C++ code as empty branches. No harm to performance, but this got cleaned up.

    • ๐Ÿ›  Some more generated code white space fixes.

    ๐Ÿ†• New Tests

    • โœ… The CPython 2.7 test suite now also has the doctests extracted to static tests, which improves test coverage for Nuitka again.

    This was previously only done for CPython 2.6 test suite, but the test suites are different enough to make this useful, e.g. to discover newly changed behavior like with the lambda generators.

    • โž• Added Shed Skin 0.7.1 examples as benchmarks, so we can start to compare Nuitka performance in these tests. These will be the focus of numbers for the 0.4.x release series.

    • โž• Added a micro benchmark to check unpacking behavior. Some of these are needed to prove that a change is an actual improvement, when its effect can go under in noise of in-line vs. no in-line behavior of the C++ compiler.

    • โž• Added "pybench" benchmark which reveals that Nuitka is for some things much faster, but there are still fields to work on. This version needed changes to stand the speed of Nuitka. These will be subject of a later posting.

    Organizational

    • โœ… There is now a "tests/benchmarks/micro" directory to contain tiny benchmarks that just look at a single aspect, but have no other meaning, e.g. the "PyStone" extracts fall into this category.

    • ๐Ÿ There is now a --windows-target option that attempts a cross-platform build on Linux to Windows executable. This is using "MingGW-cross-env" cross compilation tool chain. It's not yet working fully correctly due to the DLL hell problem with the C runtime. I hope to get this right in subsequent releases.

    • The --execute option uses wine to execute the binary if it's a cross-compile for windows.

    • ๐Ÿ Native windows build is recognized and handled with MinGW 4.5, the VC++ is not supported yet due to missing C++0x support.

    • ๐Ÿ The basic test suite ran with Windows so far only and some adaptations were necessary. Windows new lines are now ignored in difference check, and addresses under Windows are upper case, small things.

    Numbers

    python 2.6::

    Pystone(1.1) time for 50000 passes = 0.65 This machine benchmarks at 76923.1 pystones/second

    Nuitka 0.3.8 (driven by python 2.6)::

    Pystone(1.1) time for 50000 passes = 0.27 This machine benchmarks at 185185 pystones/second

    This is a 140% speed increase of 0.3.8 compared to CPython, up from 132% ๐Ÿš€ compared to the previous release.

  • v0.3.7 Changes

    ๐Ÿš€ This is about the new release with focus on performance and cleanups. It ๐Ÿš€ indicates significant progress with the milestone this release series really is about as it adds a compiled_method type.

    So far functions, generator function, generator expressions were compiled objects, but in the context of classes, functions were wrapped in CPython instancemethod objects. The new compiled_method is specifically designed for wrapping compiled_function and therefore more efficient at it.

    ๐Ÿ› Bug fixes

    • When using Python or Nuitka.py to execute some script, the exit code in case of "file not found" was not the same as CPython. It should be 2, not 1.

    • The exit code of the created programs (--deep mode) in case of an uncaught exception was 0, now it an error exit with value 1, like CPython does it.

    • ๐Ÿ‘ป Exception tracebacks created inside with statements could contain duplicate lines, this was corrected.

    ๐Ÿ†• New Optimization

    • Global variable assignments now also use assign0 where no reference exists.

    The assignment code for module variables is actually faster if it needs not drop the reference, but clearly the code shouldn't bother to take it on the outside just for that. This variant existed, but wasn't used as much so far.

    • The instance method objects are now Nuitka's own compiled type too. This should make things slightly faster by itself.

    • ๐Ÿ“œ Our new compiled method objects support dedicated method parsing code, where self is passed directly, allowing to make calls taking a fast path in parameter parsing.

    This avoids allocating/freeing a tuple object per method call, while reduced 3% ticks in "PyStone" benchmark, so that's significant.

    • Solved a TODO of BUILTIN_RANGE to change it to pre-allocating the list in the final size as we normally do everywhere else. This was a tick reduction of 0.4% in "PyStone" benchmark, but the measurement method normalizes on loop speed, so it's not visible in the numbers output.

    • Parameter variables cannot possibly be uninitialized at creation and most often they are never subject to a del statement. Adding dedicated C++ variable classes gave a big speedup, around 3% of "PyStone" benchmark ticks.

    • Some abstract object operations were re-implemented, which allows to avoid function calls e.g. in the ITERATOR_NEXT case, this gave a few percent on "PyStone" as well.

    Cleanups

    • ๐Ÿ†• New package nuitka.codegen to contain all code generation related stuff, moved nuitka.templates to nuitka.codegen.templates as part of that.

    • ๐Ÿ“ฆ Inside the nuitka.codegen package the MainControl module now longer reaches into Generator for simple things, but goes through CodeGeneration for everything now.

    • The Generator module uses almost no tree nodes anymore, but instead gets information passed in function calls. This allows for a cleanup of the interface towards CodeGeneration. Gives a cleaner view on the C++ code generation, and generally furthers the goal of other than C++ language backends.

    • ๐Ÿ‘• More "PyLint" work, many of the reported warnings have been addressed, but it's not yet happy.

    • 0๏ธโƒฃ Defaults for yield and return are None and these values are now already added (as constants) during tree building so that no such special cases need to be dealt with in CodeGeneration and future analysis steps.

    • ๐Ÿ“œ Parameter parsing code has been unified even further, now the whole entry point is generated by one of the function in the new nuitka.codegen.ParameterParsing module.

    • ๐Ÿ‘ป Split variable, exception, built-in helper classes into separate header files.

    ๐Ÿ†• New Tests

    • The exit codes of CPython execution and Nuitka compiled programs are now compared as well.

    • โœ… Errors messages of methods are now covered by the ParameterErrors test as well.

    Organizational

    • A new script "benchmark.sh" (now called "run-valgrind.py") script now starts "kcachegrind" to display the valgrind result directly.

    One can now use it to execute a test and inspect valgrind information right away, then improve it. Very useful to discover methods for improvements, test them, then refine some more.

    • The "check-release.sh" script needs to unset NUITKA_EXTRA_OPTIONS or else the reflection test will trip over the changed output paths.

    Numbers

    python 2.6::

    Pystone(1.1) time for 50000 passes = 0.65 This machine benchmarks at 76923.1 pystones/second

    Nuitka 0.3.7 (driven by python 2.6)::

    Pystone(1.1) time for 50000 passes = 0.28 This machine benchmarks at 178571 pystones/second

    This is a 132% speed of 0.3.7 compared to CPython, up from 109% compare to the ๐Ÿš€ previous release. This is a another small increase, that can be fully attributed to milestone 2 measures, i.e. not analysis, but purely more efficient C++ code generation and the new compiled method type.

    One can now safely assume that it is at least twice as fast, but I will try and โœ… get the PyPy or Shedskin test suite to run as benchmarks to prove it.

    ๐Ÿš€ No milestone 3 work in this release. I believe it's best to finish with milestone 2 first, because these are quite universal gains that we should have covered.

  • v0.3.6 Changes

    ๐Ÿš€ The major point this for this release is cleanup work, and generally bug fixes, ๐Ÿš€ esp. in the field of importing. This release cleans up many small open ends of Nuitka, closing quite a bunch of consistency TODO items, and then aims at cleaner structures internally, so optimization analysis shall become "easy". It ๐Ÿš€ is a correctness and framework release, not a performance improvement at all.

    ๐Ÿ› Bug fixes

    • Imports were not respecting the level yet. Code like this was not working, now it is:

    .. code-block:: python

     from .. import something
    
    • Absolute and relative imports were e.g. both tried all the time, now if you specify absolute or relative imports, it will be attempted in the same way than CPython does. This can make a difference with compatibility.

    • Functions with a "locals dict" (using locals built-in or exec statement) were not 100% compatible in the way the locals dictionary was updated, this got fixed. It seems that directly updating a dict is not what CPython does at all, instead it only pushes things to the dictionary, when it believes it has to. Nuitka now does the same thing, making it faster and more compatible at the same time with these kind of corner cases.

    • ๐Ÿ“ฆ Nested packages didn't work, they do now. Nuitka itself is now successfully using nested packages (e.g. nuitka.transform.optimizations)

    ๐Ÿ†• New Features

    • The --lto option becomes usable. It's not measurably faster immediately, and it requires g++ 4.6 to be available, but then it at least creates smaller binaries and may provide more optimization in the future.

    ๐Ÿ†• New Optimization

    • Exceptions raised by pre-computed built-ins, unpacking, etc. are now transformed to raising the exception statically.

    Cleanups

    • There is now a getVariableForClosure that a variable provider can use. Before that it guessed from getVariableForReference or getVariableForAssignment what might be the intention. This makes some corner cases easier.

    • ๐Ÿ— Classes, functions and lambdas now also have separate builder and body nodes, which enabled to make getSameScopeNodes() really simple. Either something has children which are all in a new scope or it has them in the same scope.

    • โ†ช Twisted workarounds like TransitiveProvider are no longer needed, because class builder and class body were separated.

    • ๐Ÿ†• New packages nuitka.transform.optimizations and nuitka.transform.finalizations, where the first was nuitka.optimizations before. There is also code in nuitka.transform that was previously in a dedicated module. This allowed to move a lot of displaced code.

    • TreeBuilding now has fast paths for all 3 forms, things that need a "provider", "node", and "source_ref"; things that need "node" and "source_ref"; things that need nothing at all, e.g. pass.

    • ๐Ÿ— Variables now avoid building duplicated instances, but instead share one. Better for analysis of them.

    ๐Ÿ†• New Tests

    • โœ… The Python 2.7 test suite is no longer run with Python 2.6 as it will just crash with the same exception all the time, there is no importlib in 2.6, but every test is using that through test_support.

    • ๐Ÿ“ฆ Nested packages are now covered with tests too.

    • ๐Ÿ“ฆ Imports of upper level packages are covered now too.

    Organizational

    • โšก๏ธ Updated the "README.txt" with the current plan on optimization.

    Numbers

    python 2.6::

    Pystone(1.1) time for 50000 passes = 0.65 This machine benchmarks at 76923.1 pystones/second

    Nuitka 0.3.6 (driven by python 2.6)::

    Pystone(1.1) time for 50000 passes = 0.31 This machine benchmarks at 161290 pystones/second

    ๐Ÿš€ This is 109% for 0.3.6, but no change from the previous release. No surprise, because no new effective new optimization means have been implemented. Stay ๐Ÿš€ tuned for future release for actual progress.

  • v0.3.5 Changes

    ๐Ÿš€ This new release of Nuitka is an overall improvement on many fronts, there is no real focus this time, likely due to the long time it was in the making.

    The major points are more optimization work, largely enhanced import handling ๐ŸŽ and another improvement on the performance side. But there are also many bug ๐Ÿ›  fixes, more test coverage, usability and compatibility.

    Something esp. noteworthy to me and valued is that many important changes were performed or at least triggered by Nicolas Dumazet, who contributed a lot of ๐Ÿ‘€ high quality commits as you can see from the gitweb history. He appears to try and compile Mercurial and Nuitka, and this resulted in important contributions.

    ๐Ÿ› Bug fixes

    • Nicolas found a reference counting bug with nested parameter calls. Where a function had parameters of the form a, (b,c) it could crash. This got fixed and covered with a reference count test.

    • Another reference count problem when accessing the locals dictionary was corrected.

    • Values 0.0 and -0.0 were treated as the same. They are not though, they have a different sign that should not get lost.

    • Nested contractions didn't work correctly, when the contraction was to iterate over another contraction which needs a closure. The problem was addressing by splitting the building of a contraction from the body of the contraction, so that these are now 2 nodes, making it easy for the closure handling to get things right.

    • Global statements in function with local exec() would still use the value from the locals dictionary. Nuitka is now compatible to CPython with this too.

    • ๐Ÿ›  Nicolas fixed problems with modules of the same name inside different packages. We now use the full name including parent package names for code generation and look-ups.

    • The __module__ attribute of classes was only set after the class was created. Now it is already available in the class body.

    • The __doc__ attribute of classes was not set at all. Now it is.

    • ๐Ÿ“ฆ The relative import inside nested packages now works correctly. With Nicolas moving all of Nuitka to a package, the compile itself exposed many weaknesses.

    • ๐Ÿ‘ป A local re-raise of an exception didn't have the original line attached but the re-raise statement line.

    ๐Ÿ†• New Features

    • ๐Ÿ“ฆ Modules and packages have been unified. Packages can now also have code in "init.py" and then it will be executed when the package is imported.

    • Nicolas added the ability to create deep output directory structures without having to create them beforehand. This makes --output-dir=some/deep/path usable.

    • ๐Ÿ— Parallel build by Scons was added as an option and enabled by default, which enhances scalability for --deep compilations a lot.

    • ๐Ÿ— Nicolas enhanced the CPU count detection used for the parallel build. Turned out that multithreading.cpu_count() doesn't give us the number of available cores, so he contributed code to determine that.

    • ๐Ÿ‘Œ Support for upcoming g++ 4.6 has been added. The use of the new option --lto has been been prepared, but right now it appears that the C++ compiler will need more fixes, before we can this feature with Nuitka.

    • The --display-tree feature got an overhaul and now displays the node tree along with the source code. It puts the cursor on the line of the node you selected. Unfortunately I cannot get it to work two-way yet. I will ask for help with this in a separate posting as we can really use a "python-qt" expert it seems.

    • โž• Added meaningful error messages in the "file not found" case. Previously I just didn't care, but we sort of approach end user usability with this.

    ๐Ÿ†• New Optimization

    • โž• Added optimization for the built-in range() which otherwise requires a module and builtin module lookup, then parameter parsing. Now this is much faster with Nuitka and small ranges (less than 256 values) are converted to constants directly, avoiding run time overhead entirely.

    • ๐Ÿ‘ป Code for re-raise statements now use a simple re-throw of the exception where possible, and only do the hard work where the re-throw is not inside an exception handler.

    • Constant folding of operations and comparisons is now performed if the operands are constants.

    • Values of some built-ins are pre-computed if the operands are constants.

    • The value of module attribute __name__ is replaced by a constant unless it is assigned to. This is the first sign of upcoming constant propagation, even if only a weak one.

    • Conditional statement and/or their branches are eliminated where constant conditions allow it.

    Cleanups

    • ๐Ÿ“ฆ Nicolas moved the Nuitka source code to its own nuitka package. That is going to make packaging it a lot easier and allows cleaner code.

    • ๐Ÿ— Nicolas introduced a fast path in the tree building which often delegates (or should do that) to a function. This reduced a lot of the dispatching code and highlights more clearly where such is missing right now.

    • ๐Ÿ’… Together we worked on the line length issues of Nuitka. We agreed on a style and very long lines will vanish from Nuitka with time. Thanks for pushing me there.

    • ๐Ÿ’… Nicolas also did provide many style fixes and general improvements, e.g. using PyObjectTemporary in more places in the C++ code, or not using str.find where x in y is a better choice.

    • The node structure got cleaned up towards the direction that assignments always have an assignment as a child.

    A function definition, or a class definition, are effectively assignments, and in order to not have to treat this as special cases everywhere, they need to have assignment targets as child nodes.

    Without such changes, optimization will have to take too many things into account. This is not yet completed.

    • ๐Ÿ— Nicolas merged some node tree building functions that previously handled deletion and assigning differently, giving us better code reuse.

    • ๐Ÿšš The constants code generation was moved to a __constants.cpp where it doesn't make main.cpp so much harder to read anymore.

    • ๐Ÿšš The module declarations have been moved to their own header files.

    • โœ… Nicolas cleaned up the scripts used to test Nuitka big time, removing repetitive code and improving the logic. Very much appreciated.

    • Nicolas also documented a things in the Nuitka source code or got me to document things that looked strange, but have reasons behind it.

    • Nicolas solved the TODO related to built-in module accesses. These will now be way faster than before.

    • ๐ŸŽ Nicolas also solved the TODO related to the performance of "locals dict" variable accesses.

    • Generator.py no longer contains classes. The Contexts objects are supposed to contain the state, and as such the generator objects never made much sense.

    • Also with the help of Scons community, I figured out how to avoid having object files inside the src directory of Nuitka. That should also help packaging, now all build products go to the .build directory as they should.

    • The vertical white space of the generated C++ got a few cleanups, trailing/leading new line is more consistent now, and there were some assertions added that it doesn't happen.

    ๐Ÿ†• New Tests

    • โœ… The CPython 2.6 tests are now also run by CPython 2.7 and the other way around and need to report the same test failure reports, which found a couple of issues.

    • โœ… Now the test suite is run with and without --debug mode.

    • โœ… Basic tests got extended to cover more topics and catch more issues.

    • ๐Ÿ“ฆ Program tests got extended to cover code in packages.

    • โž• Added more exec scope tests. Currently inlining of exec statements is disabled though, because it requires entirely different rules to be done right, it has been pushed back to the next release.

    Organizational

    • The g++-nuitka script is no more. With the help of the Scons community, this is now performed inside the scons and only once instead of each time for every C++ file.

    • When using --debug, the generated C++ is compiled with -Wall and -Werror so that some form of bugs in the generated C++ code will be detected immediately. This found a few issues already.

    • ๐Ÿ”€ There is a new git merge policy in place. Basically it says, that if you submit me a pull request, that I will deal with it before publishing anything new, so you can rely on the current git to provide you a good base to work on. I am doing more frequent pre-releases already and I would like to merge from your git.

    • โšก๏ธ The "README.txt" was updated to reflect current optimization status and plans. There is still a lot to do before constant propagation can work, but this explains things a bit better now. I hope to expand this more and more with time.

    • ๐Ÿ–จ There is now a "misc/clean-up.sh" script that prints the commands to erase all the temporary files sticking around in the source tree.

    That is for you if you like me, have other directories inside, ignored, that you don't want to delete.

    • ๐Ÿ–จ Then there is now a script that prints all source filenames, so you can more easily open them all in your editor.

    • ๐Ÿš€ And very important, there is now a "check-release.sh" script that performs all the tests I think should be done before making a release.

    • ๐Ÿ‘• Pylint got more happy with the current Nuitka source. In some places, I added comments where rules should be granted exceptions.

    Numbers

    python 2.6::

    Pystone(1.1) time for 50000 passes = 0.65 This machine benchmarks at 76923.1 pystones/second

    Nuitka 0.3.5 (driven by python 2.6)::

    Pystone(1.1) time for 50000 passes = 0.31 This machine benchmarks at 161290 pystones/second

    This is 109% for 0.3.5, up from 91% before.

    ๐Ÿš€ Overall this release is primarily an improvement in the domain of compatibility ๐Ÿ›  and contains important bug and feature fixes to the users. The optimization framework only makes a first showing of with the framework to organize them. There is still work to do to migrate optimization previously present

    ๐Ÿ‘€ It will take more time before we will see effect from these. I believe that even more cleanups of TreeBuilding, Nodes and CodeGeneration will ๐ŸŽ be required, before everything is in place for the big jump in performance numbers. But still, passing 100% feels good. Time to rejoice.

  • v0.3.4 Changes

    ๐Ÿš€ This new release of Nuitka has a focus on re-organizing the Nuitka generated ๐ŸŽ source code and a modest improvement on the performance side.

    For a long time now, Nuitka has generated a single C++ file and asked the C++ compiler to translate it to an executable or shared library for CPython to load. This was done even when embedding many modules into one (the "deep" compilation mode, option --deep).

    This was simple to do and in theory ought to allow the compiler to do the most optimization. But for large programs, the resulting source code could have exponential compile time behavior in the C++ compiler. At least for the GNU g++ this was the case, others probably as well. This is of course at the end a scalability issue of Nuitka, which now has been addressed.

    ๐Ÿš€ So the major advancement of this release is to make the --deep option ๐ŸŽ useful. But also there have been a performance improvements, which end up giving us another boost for the "PyStone" benchmark.

    ๐Ÿ› Bug fixes

    • ๐Ÿ“ฆ Imports of modules local to packages now work correctly, closing the small compatibility gap that was there.

    • Modules with a "-" in their name are allowed in CPython through dynamic imports. This lead to wrong C++ code created. (Thanks to Li Xuan Ji for reporting and submitting a patch to fix it.)

    • โš  There were warnings about wrong format used for Ssize_t type of CPython. (Again, thanks to Li Xuan Ji for reporting and submitting the patch to fix it.)

    • ๐Ÿ‘ป When a wrong exception type is raised, the traceback should still be the one of the original one.

    • Set and dict contractions (Python 2.7 features) declared local variables for global variables used. This went unnoticed, because list contractions don't generate code for local variables at all, as they cannot have such.

    • Using the type() built-in to create a new class could attribute it to the wrong module, this is now corrected.

    ๐Ÿ†• New Features

    • ๐Ÿ— Uses Scons to execute the actual C++ build, giving some immediate improvements.

    • ๐Ÿ— Now caches build results and Scons will only rebuild as needed.

    • The direct use of __import__() with a constant module name as parameter is also followed in "deep" mode. With time, non-constants may still become predictable, right now it must be a real CPython constant string.

    ๐Ÿ†• New Optimization

    • โž• Added optimization for the built-ins ord() and chr(), these require a module and built-in module lookup, then parameter parsing. Now these are really quick with Nuitka.

    • โž• Added optimization for the type() built-in with one parameter. As above, using from builtin module can be very slow. Now it is instantaneous.

    • โž• Added optimization for the type() built-in with three parameters. It's rarely used, but providing our own variant, allowed to fix the bug mentioned above.

    Cleanups

    • Using scons is a big cleanup for the way how C++ compiler related options are applied. It also makes it easier to re-build without Nuitka, e.g. if you were using Nuitka in your packages, you can easily build in the same way than Nuitka does.

    • ๐Ÿšš Static helpers source code has been moved to ".hpp" and ".cpp" files, instead of being in ".py" files. This makes C++ compiler messages more readable and allows us to use C++ mode in Emacs etc., making it easier to write things.

    • Generated code for each module ends up in a separate file per module or package.

    • Constants etc. go to their own file (although not named sensible yet, likely going to change too)

    • Module variables are now created by the CPythonModule node only and are unique, this is to make optimization of these feasible. This is a pre-step to module variable optimization.

    ๐Ÿ†• New Tests

    • โž• Added "ExtremeClosure" from my Python quiz, it was not covered by existing tests.

    • โž• Added test case for program that imports a module with a dash in its name.

    • โž• Added test case for main program that starts with a dash.

    • โœ… Extended the built-in tests to cover type() as well.

    Organizational

    • There is now a new environment variable NUITKA_SCONS which should point to the directory with the SingleExe.scons file for Nuitka. The scons file could be named better, because it is actually one and the same who builds extension modules and executables.

    • There is now a new environment variable NUITKA_CPP which should point to the directory with the C++ helper code of Nuitka.

    • The script "create-environment.sh" can now be sourced (if you are in the top level directory of Nuitka) or be used with eval. In either case it also reports what it does.

    .. admonition:: Update

     The script has become obsolete now, as the environment variables are no
     longer necessary.
    
    • ๐Ÿ— To cleanup the many "Program.build" directories, there is now a "clean-up.sh" script for your use. Can be handy, but if you use git, you may prefer its clean command.

    .. admonition:: Update

     The script has become obsolete now, as Nuitka test executions now by
     default delete the build results.
    

    Numbers

    python 2.6::

    Pystone(1.1) time for 50000 passes = 0.65 This machine benchmarks at 76923.1 pystones/second

    Nuitka 0.3.4::

    Pystone(1.1) time for 50000 passes = 0.34 This machine benchmarks at 147059 pystones/second

    This is 91% for 0.3.4, up from 80% before.