• Stars
    star
    558
  • Rank 79,819 (Top 2 %)
  • Language
    Rust
  • License
    MIT License
  • Created over 5 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

an educational compiler intermediate representation

Bril: A Compiler Intermediate Representation for Learning

Bril (the Big Red Intermediate Language) is a compiler IR made for teaching CS 6120, a grad compilers course. It is an extremely simple instruction-based IR that is meant to be extended. Its canonical representation is JSON, which makes it easy to build tools from scratch to manipulate it.

This repository contains the documentation, including the language reference document, and some infrastructure for Bril. There are some quick-start instructions below for some of the main tools, but check out the docs for more details about what's available.

Install the Tools

Reference Interpreter

You will want the IR interpreter, which uses Deno. Just type this:

$ deno install brili.ts

As Deno tells you, you will then need to add $HOME/.deno/bin to your $PATH. You will then have brili, which takes a Bril program as JSON on stdin and executes it.

Text Format

The parser & pretty printer for the human-editable text form of Bril are written for Python 3. To install them, you need Flit, so run this:

$ pip install --user flit

Then, go to the bril-txt directory and use Flit to install symlinks to the tools:

$ flit install --symlink --user

The tools are called bril2json and bril2txt. They also take input on stdin and produce output on stdout.

Tests

There are some tests in the test/ directory. They use Turnt, which lets us write the expected output for individual commands. Install it with pip:

$ pip install --user turnt

Then run all the tests by typing make test.

More Repositories

1

cs6120

advanced compilers
HTML
746
star
2

llvm-pass-skeleton

example LLVM pass
C++
550
star
3

wideq

reverse-engineered client for the LG SmartThinQ API
Python
329
star
4

hass-smartthinq

Home Assistant component for LG SmartThinQ HVAC devices
Python
285
star
5

ppl-intro

probabilistic programming for PL folks
Makefile
152
star
6

bluelet

simple asynchronous socket I/O with Python coroutines
Python
110
star
7

quala

custom type systems for Clang
C++
96
star
8

emfed

embed your Mastodon feed into your web page
TypeScript
76
star
9

flatcalc

world's worst interpreter
Rust
48
star
10

hooknook

a little place for your deployments
Python
47
star
11

tinygl

itsy-bitsy OpenGL and GLSL example
C
47
star
12

cluster-workers

a Python client/master/worker system for distributing jobs in a cluster
Python
44
star
13

llvm-ei

extensible interpreter for LLVM dynamic analyses
C++
43
star
14

minisynth

program synthesis is possible
Python
39
star
15

clusterfutures

super-slick Slurm and Condor cluster execution for Python
Python
23
star
16

homebrew-mspgcc

formulae for the MSP430 microcontroller compiler toolchain
Ruby
21
star
17

vegalive

live preview of Vega visualizations
JavaScript
18
star
18

home

my academic site and blog
HTML
18
star
19

bibble

another BibTeX-to-HTML (with Jinja2 templates)
Python
15
star
20

autolink.vim

automatically search for & insert URL targets for links in Markdown & ReST
Vim Script
10
star
21

approxbib

annotated bibliography on approximate computing
TeX
9
star
22

loglet

send log messages to the web
Python
8
star
23

lua-sundown

process Markdown safely and quickly in Lua
C
7
star
24

dq

dead-simple download queue manager
Python
7
star
25

madoko-template

style+Makefile skeleton for writing with Madoko
Makefile
6
star
26

lang-start

skeleton for a language implementation in OCaml
OCaml
5
star
27

jsonshelve

simple, multi-backend key/value persistence for Python
Python
5
star
28

python-blekko

bindings for the Blekko search engine API
Python
5
star
29

docker-rpi-mopidy

Mopidy for Raspberry Pi via Docker
5
star
30

mblite

experimental SQLite database for MusicBrainz
Python
5
star
31

tdot

simple terminal output for GraphViz
Python
5
star
32

bkp1696

control and query the BK Precision 1696 power supply
Python
4
star
33

homebrew-py

Python-related additional packages for Homebrew
Ruby
4
star
34

velocity

simple, fast Notational Velocity for the terminal
Rust
4
star
35

clang-quala

Clang with type annotations
C++
4
star
36

cs3410-infra

public infrastructure for Cornell's CS 3410
Dockerfile
4
star
37

greatisas

The Great ISAs
HTML
3
star
38

execnet-futures

use concurrent.futures on a cluster via execnet
Python
3
star
39

stapler

experimental unstructured static site generator
Python
3
star
40

codegrade

simple autograder tool for running tests on student code
Python
3
star
41

fdpo

Python
2
star
42

campuslack

connect Campuswire to Slack
TypeScript
2
star
43

mruf

farm accounting and ordering system
Python
2
star
44

delete

uncrudify the new ACM Digital Library
JavaScript
2
star
45

ap

adaptive parsing
Python
2
star
46

madmin

replace yourself with a few short shell scripts
Go
2
star
47

thesis

Hardware and Software for Approximate Computing
TeX
2
star
48

enerj

Java
2
star
49

liveserve

flexible command-line LiveReload server
Python
1
star
50

samizdat

just a numerical data converter
Rust
1
star
51

vivado-example

just a minimal tcl setup for running Vivado synthesis on a self-contained design
SystemVerilog
1
star
52

enerj-apps

Java
1
star
53

imbib

cite papers by URL
Python
1
star
54

antisocial

minimal ActivityPub server
Rust
1
star
55

docker-rpi-shairplay

Shairplay on Raspberry Pi via Docker
1
star
56

wh

Python
1
star
57

mute-orb

conjure an orb of silence
Python
1
star
58

need4approval

feeding an unhealthy addiction
Python
1
star
59

rematch

research matching tool
Python
1
star
60

sp110e-mqtt

control SP110E LED devices via MQTT
Python
1
star
61

fake

it's a fake
Rust
1
star