Project 1: Make Something Cool for Bril

Overview

Your mission in this project is to make something cool that extends the Bril ecosystem. Bril is the shared programming language we'll use for some work in this class. (Building tools around a common language will let us learn from and build on each other's work.) The idea is to make something that extends Bril to make it more realistic, that makes your life easier when using Bril, or just accomplishes something snazzy using Bril programs. Together, we'll build up an ecosystem to support increasingly cool projects. Your secondary goal in this project is to get experience using Bril and its tools so you'll be ready to implement more sophisticated transformations and optimizations for it in the next project.

Because this is a warm-up project, I encourage you to think small when proposing an idea. Pick something self-contained that you can get done in a couple of weeks—but something that you will still consider cool when you're finished.

Like every 6120 project, however, you will need to do some sort of empirical measurement for this project. Make your evaluation small in scale but rigorous: you might try out your cool thing on a collection of programs and manually check that it does the right thing on most of them, for example, if there's nothing quantitative to collect.

Ideas

Here are some ideas for projects that fit in the scope of this project.

Extending the Language

Bril is a pretty simple language right now. You could extend it to do something new, either as a core feature or an optional extension:

If you extend the language, you'll want to be sure you at least add to the reference interpreter, the documentation, and the textual representation tools (if necessary).

And here’s a different kind of extension project: you could generalize the notion of Bril extensions. Build a mechanism for specifying and using language extensions so that tools can, for example, easily reject programs that use unsupported extensions or handle new instructions that they don’t know about.

Extending the TypeScript Frontend

I have written a small compiler frontend, ts2bril, that compiles a small subset of TypeScript to Bril. This makes it a little easier to write Bril programs that do something interesting. There are lots of ways you could extend this compiler to make its TypeScript subset more complete:

If you pick this path, you'll want to take a careful look at my fledgling frontend to see exactly what I have and have not implemented yet.

A different kind of project you could propose could involve creating a benchmark suite based on the TypeScript frontend. You could assemble small programs from a well-known source, port them to the small TypeScript subset we support, and document their characteristics for other projects on expressiveness or performance to use.

Other Frontends

You could build a new frontend for generating Bril code. I can imagine two flavors of this project:

Backends

I don't think it would be too hard to build a backend that translates Bril programs into Java bytecode, WebAssembly, or LLVM IR. Or as silly as it seems, you could even translate Bril into another user-facing language, such as JavaScript or C.

Tools on the Side

Here are some ideas for tools that read or write Bril programs:

Doing the Project

Before you even propose an idea, I recommend you familiarize yourself with the current Bril infrastructure. Write some programs, read some programs, and execute some programs in the interpreter.

Propose an idea that you think will yield a cool result. This means it should probably be as ambitious as you can muster within the given (short) time frame. To submit your proposal, see the general 6120 project instructions. Be sure to include your plan for measuring your success.

I implemented Bril in a "monorepo," meaning that lots of interrelated but separate projects live together in the same version control repository. This is nice because it lets us be sure that all the tools agree on a consistent version of the language. Therefore, unless you have a good reason to, please plan on contributing your work back to the "official" Bril GitHub repository. When you're done with your implementation, you can open a pull request.

You will probably want to write some tests for whatever you implement. The Bril infrastructure uses Turnt, a low-effort testing tool developed in the Capra lab. We invite you to use Turnt for your code also, if you're into it.

When you write your report, please again see the general advice about 6120 projects. Remember that your audience for the report is your peers in 6120 and the rest of the world—not your instructor. Write your report to be accessible to interested experts.