Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework codegen system #9

Open
shBLOCK opened this issue May 14, 2024 · 0 comments
Open

Rework codegen system #9

shBLOCK opened this issue May 14, 2024 · 0 comments

Comments

@shBLOCK
Copy link
Owner

shBLOCK commented May 14, 2024

A new codegen system that's code-based instead of text-based.
It should first produce something like an AST file as an intermediate representation.
Then Cython source and stubs are generated from the intermediate file.

The intermediate representation doesn't need to be an actual AST like that used in the Python compiler. It can be of a higher level.
For example, a + b + c + d may be represented as Sum("a", "b", "c", "d").
This makes optimization attempts easier.

With this reworked system, codegen won't get progressively messier with each new functionality.
For example, stub generation can be done directly based on the intermediate representation instead of parsing the generated source once again (which is how it is done right now).
It also (potentially) enables generating code for multiple platforms (eg. MicroPython).

@shBLOCK shBLOCK pinned this issue May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant