Source to source, Python idiomatic compiler, insiper by Pyrs.
There is Idea about compile Python's slow code to (Cython, C, Rust), then compile destination source code in Binary library or exec. Now it works based on Abstract Syntax Tree and visitors stategy.
Future Idea is about to disassembling Python's source code, then using C API to reverse Python's Opcodes to Assembler Opcodes. This way can be more complex, but Idea looks clear. It will have a some (python opcodes to assembler opcodes mapping). Sounds crazy but who cares 😂
Lobster's original idea is about to write low-level,high-performance extensions of the Python language in Python itself,without knowledge of:
- C/Cython
- C API/C FFI
- PyPy/Numba and else.
In simple terms, you write slow Python code, and Lobster will compile your Python source code into C, Rust, Go source code. For example, a Python class will be transpiled into a Rust struct, where Python class methods will be implementations into the Rust struct. Inheritance and, Multiple inheritance will be represented as a chain of structures extending each other
It will neatly collect a tree of all calls, variables, functions, classes, modules, and compile a structural tree for them for the target source code. Some implementations allow for instant embedding extensions into your Python Environment.
For example, Rust has Pyo3 and Maturin, and C has CFFI, CAPI, Cython.
Lobster based on AST (Abstract Syntax Tree) and it extends the standard Visitor structure.