Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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++
- Host: GitHub
- URL: https://github.com/gf712/python-cpp
- Owner: gf712
- Created: 2021-07-09T17:22:17.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-17T18:13:18.000Z (about 2 months ago)
- Last Synced: 2024-09-17T22:35:13.718Z (about 2 months ago)
- Topics: cpp, interpreter, python
- Language: C++
- Homepage:
- Size: 2.53 MB
- Stars: 12
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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#))