Skip to content

Project Proposal: Brilooped #504

@gerardogtn

Description

@gerardogtn

What will you do?

  • The idea is to implement the relooper algorithm to convert bril programs into bril programs with structured control flow.
  • The idea is that we'll be able to write bril programs with two extra constructs: if-then-else and while loops.
  • To generate brilooped programs, you'll be able to write them by hand and compile them to bril.
  • Or you'll be able to generate briloop programs from bril files, a translation implemented using Ramsey's relooper algorithm.
  • Another team (Michael, Annabel, and Serena) will work on a project that transforms briloop programs into webassembly. We'll coordinate with them on the file format and our end goal is that we can build a fulll pipeline bril -> briloop -> wasm.

How will you do it?

  • To implement the compilation from briloop to bril we'll use a classic compiler pipeline that will translate while and if statements into blocks and jump instructions. The main idea of this phase is to grow comfortable with the grammar for brilooped programs and to enable us to test autogenerated brilooped programs. We hope to spend only a small amount of time in this phase.
  • To implement compilation from bril to briloop we'll use the relooper algorithm from Ramsey. We hope to spend a majority of time of the project in this stage.

How will you empirically measure success?

  • By implementing a full translation loop! bril -> briloop -> bril and test the output back on bril benchmarks.
  • Our goal is for the implementation to be correct (i.e. the output of each program is equivalent), we can also establish a metric of efficiency in terms of how many dynamic instructions are executed for the original bril vs the translated bril program.
  • As a stretch goal, it would be fun to compare how different some programs look if we write briloop by hand vs by compiling bril to brilooper! Would any optimizations over a bril program lead to significant different briloop program?

Team members:
@devv64
@gerardogtn

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalcourse project proposals

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions