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

add middle lang to help translating language into LLVM IR #9

Open
Memorytaco opened this issue Apr 29, 2023 · 2 comments
Open

add middle lang to help translating language into LLVM IR #9

Memorytaco opened this issue Apr 29, 2023 · 2 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@Memorytaco
Copy link
Owner

No description provided.

@Memorytaco Memorytaco self-assigned this Jun 18, 2023
@Memorytaco
Copy link
Owner Author

As far as i know, there are three choices for the middle language and they are SSA, CPS and ANF. Since LLVM IR is represented in SSA form, and since it is not obvious on how to translate a surface language directly to SSA, we are left with
SSA and ANF. Both of them seems to be common practice for a functional language compiler and i believe ANF should be a better choice in this code base because of Expr structure used in project.

Use Expr to represent an ANF Node is trivial and defining pass between Expr is straightforward. (see pass definition and a taste for codegen)

This seems to be a good choice but more experience is required to verify this.

@Memorytaco Memorytaco added the help wanted Extra attention is needed label Jun 18, 2023
@Memorytaco
Copy link
Owner Author

This is required for writing JIT functionality for REPL. Before we go deep into a formal definition of this structure, we need to define a "usable" structure to help translating partial IR into LLVM IR for supporting JIT in REPL and also further studying in this IR form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
Status: In Progress
Development

No branches or pull requests

1 participant