New Python implementation
Mr Flibble
flibble at i42.REMOVETHISBIT.co.uk
Thu Feb 11 12:56:09 EST 2021
On 11/02/2021 16:31, Dan Stromberg wrote:
> On Thu, Feb 11, 2021 at 4:35 AM Mr Flibble <flibble at i42.removethisbit.co.uk>
> wrote:
>
>>
>> Hi!
>>
>> I am starting work on creating a new Python implementation from scratch
>> using "neos" my universal compiler that can compile any programming
>> language. I envision this implementation to be significantly faster than
>> the currently extant Python implementations (which isn't a stretch given
>> how poorly they perform).
>>
>
> I'd like to encourage you to give this a go. It's a huge task, but it's
> needed.
Actually it is a relatively small task due to the neos universal compiler's architectural design. If it was a large task I wouldn't be doing it.
>
> You may be interested in the approaches of Pypy, Cython, Shedskin and
> Nuitka.
I am not particularly interested in any of the existing implementations as they bear no relation to the design of my language agnostic universal compiler, runtime, VM and JIT; the only use they will have will be to disambiguate certain Python language constructs that I cannot disambiguate from documentation alone: this is a natural consequence of Python not being standardized; those steering the language need to grow a pair and get Python standardized preferably as an ISO Standard.
>
> Pypy is a Python written in RPython, where RPython is a restricted subset
> of Python 2. It can translate RPython to C, or JIT compile pretty full
> Python code - 2.x or 3.x. It has trouble with C extension modules, as the
> CPython API for extension modules is pretty leaky. CFFI appears to be the
> big hope of fixing this problem, but most C extension modules still use the
> CPython C extension Module API.
RPython doesn't interest me. neos will be using libffi for FFI.
>
> Cython transpiles a Python-like language to C. It allows you to intermix
> Python datatypes and C datatypes; the more you use C datatypes, the faster
> the result is. It can be slower if you aren't careful with your type
> conversions, but it can be faster if used well. It has a really nice
> --annotate option that shows how close to C your program is, line by line.
I don't agree with the concept of delivering C compilers to end users. The only compilers I think end users should be running are GPU shader compilers and byecode/JIT compilers such as neos.
>
> Shedskin transpiles an implicitly static subset of Python 2 to C++. It's a
> great tool, but sadly it is unlikely to make the jump from Python 2 to
> Python 3, and Python 3 is definitely the future of Python.
Not interested in that (see previous answer replacing "C" with "C++").
>
> Nuitka is a Python -> C/C++ transpiler. I know little about it, but it
> sounds kind of like what you're proposing. It's been focusing on
> compatibility first, followed by performance.
Bears no relation to neos architecture.
>
> Good luck!
Thanks for the sentiment but I am not relying on luck.
/Flibble
--
😎
More information about the Python-list
mailing list