Skip to content

Split compilation into multiple passes #84

@Balint-R

Description

@Balint-R

@KavinSatheeskumar suggested that it might be a good idea to split the compilation process into multiple passes, where each pass does one type of thing. This is supposedly how most other compilers work, and could help with how PyDSL code is organized.

Some possible passes include:

  • Name resolution
  • Type inference and type checking
  • Adding empty return statements if no return statement is present
  • Main pass which does the rest of the logic

One concern I have is that some parts of parsing the syntax are fundamentally recursive, so a lot of the logic would still have to stay in one pass. Also what happens if we find that something we already split into a pass actually has some recursive interaction with other passes? They would need to be moved back to the main pass, and it could be a lot of effort to do this, so I am not certain whether it will be more or less maintainable.

#51 is relevant.

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions