KEMBAR78
Generalize IR to make non-C backends possible · Issue #709 · mypyc/mypyc · GitHub
Skip to content

Generalize IR to make non-C backends possible #709

@JukkaL

Description

@JukkaL

Currently the IR is tightly bound to our C back end. This means that it's not easy to experiment with alternative back ends. This is also arguably a layering violation. It would be nice if we'd abstract away things that are specific to the C back end from the IR.

Here are some things that might need to be changed, at least:

  • Primitive ops wouldn't generate C directly but would describe the op in a more abstract way. Generating C from an op description would be separate from op descriptions.
  • Casts and boxing/unboxing ops currently translate to non-trivial C. We could split them into lower-level ops during IR generation.
  • We may want to include explicit ops for adding traceback entries in the IR. Currently they are included in branch ops.

Generally the IR would become lower-level, and each op would translate to a short snippet of C.

Later on, we could also use the lower-level IR to describe getters, setters and other generated functions which we currently directly generate as C.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions