Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gf712/python-cpp

Python implementation in C++
https://github.com/gf712/python-cpp

cpp interpreter python

Last synced: 8 days ago
JSON representation

Python implementation in C++

Awesome Lists containing this project

README

        

# Python C++ (EXPERIMENTAL + IN PROGRESS)

A Python interpreter implementation in C++. The current aim is to be compliant with the Python 3.10 spec and have releases inline with future Python versions.

# What is different from CPython?

* This interpreter uses a register-based VM, instead of stack-based VM
* JIT support (TODO: the plan is to use something like LLVM or ASMJIT to support some code optimisations at runtime)
* The runtime is written in C++, so Python Objects are C++ classes internally. This should make it easier to write C++ Python bindings.

# What doesn't change from CPython?

* Tokens generated by the Lexer are the same as in CPython (see [token list](https://docs.python.org/3/library/token.html))
* The grammar specification is the same as the one used to generate the CPython parser (see [spec](https://docs.python.org/3/reference/grammar.html))
* The AST nodes are the same ones used in CPython (see [node definitions](https://greentreesnakes.readthedocs.io/en/latest/nodes.html#))