Skip to content

Tracking issue: Implement minimum viable end-to-end compiler pipeline #4

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

Closed
bitwalker opened this issue Apr 24, 2023 · 1 comment
Closed
Assignees
Milestone

Comments

@bitwalker
Copy link
Contributor

bitwalker commented Apr 24, 2023

Goal(s)

  • Be able to express a wide variety of useful programs in Miden IR
  • Be able to compile programs from Miden IR to Miden Assembly
  • Have a test harness set up to exercise the compilation pipeline for verification

Non-Goal(s)

  • Have a Sway or Move frontend implemented

Details

In order to build a useful compiler from high-level languages to Miden Assembly (MASM), we must have an intermediate representation (IR) which is expressive enough to make lowering from high-level languages directly simple and straightforward, and general enough to be a viable target from a variety of language frontends. This IR must be able to express complex control flow not directly supported in MASM, but which meets certain constraints under which it is possible to transform into a MASM-compatible form. Furthermore, we must be able to express all of the supported MASM operations and their associated types. Additionally, the IR must be converted into a stack machine representation that matches MASM, either by lowering to MASM directly, or by undergoing a series of transformations during lowering that accomplishes that goal.

The IR we have defined currently meets all of the above requirements, but we now need to implement both the control flow transformations and the translation to MASM. Firstly, this requires a test harness which we can use to exercise the compilation pipeline and assert things about its behavior. Secondly, we must implement the translation to stack machine form and lower to MASM. The last piece of the puzzle is to wire up at least one language frontend to the compiler, but we are leaving that as a non-goal/nice-to-have for this milestone, as there are prerequisite tasks which must be tackled before we are ready for that step - namely the control flow transformations described above.

### Required
- [x] #3
- [ ] #5
- [ ] #6
- [ ] #7
- [ ] #8
- [ ] https://github.com/0xPolygonMiden/miden-ir/pull/27
- [ ] #22

NOTE: Issues have not yet been created for the above tasks, I'll create those shortly

@bitwalker
Copy link
Contributor Author

This is effectively completed now, there are a few small items remaining in #30 to knock out, but that's just a few days tops.

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

No branches or pull requests

1 participant