1. 11

  2. 14

    Free for non-commercial use. I wish GitHub would flag things with proprietary licenses. I was fortunate to see the license in the FAQ before looking at any of the code.

    1. 2

      Unusually it does explicitly state a future date at which it becomes licensed under the Apache license… not sure how GitHub could manage automatically flagging that.

    2. 10
      $ cat check.py
      print(-2 % 5)
      $ python check.py
      $ codon run check.py
      1. 2


        1. 1

          Apparently there is -numerics=py which fixes it!

          1. 6

            You’d think this would be the default! If you’re attempting to appeal to Python having teams, you’d probably want to be as compatible as possible out of the box. Weird.

      2. 9

        PyPy (https://pypy.org/) is also a pretty good compiler for python code (it’s a JIT compiler). Recently I had compared the performance of some basic string manipulation functions using CPython, PyPy, and Codon. The Codon compiled binary ran ~2x faster than CPython, PyPy ~4x faster than CPython and ~2x faster than the Codon binary (Codon binary used less RAM though). If you have an app that primarily uses the standard library and want a bit more speed (at the expense of some additional RAM), without changing any code, then PyPy is pretty useful.

        1. 3

          “zero-overhead” is a bit taking the piss when this is using LLVM… :p

          1. 1

            Is it python or more like python*? The readme seems to indicate the latter.

            1. 2

              python* — in order to compile python, you’ve either gotta give up some dynamic features, or basically fall back to interpretation. They’ve taken the stance that you don’t always use the hard to compile dynamic features, so probably safe to not have them if speed is the utmost concern.

              It does look like they have a gradual compilation, as well, where you can compile individual functions via a decorator.

            2. 1

              A high-performance, zero-overhead, extensible Python compiler using LLVM

              Is there a benchmark with respect to C anywhere?