sampsyo/bril
sampsyo/bril has 805 GitHub stars and 338 forks. GitHot measured 0 stars in 24 hours and +1 in 7 days. Last checked 2026-11-22 04:40 UTC. Last push 2026-11-05.
측정된 스타 증가
- in 24h
- 0
- in 7 days
- +1
- in 15 days
- 기록 수집 중
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
소개
an educational compiler intermediate representation
학습README.md
OriginalBril: 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 -g 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 in Python.
A good way to install them is using uv.
Install uv, then go to the bril-txt directory and type:
$ uv tool install .
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 uv:
$ uv tool install turnt
Run an individual test by typing something like turnt test/interp/core/tiny.bril.
To run the full test suite, first install the type checker and TypeScript compiler:
$ deno install -g brilck.ts
$ deno install -g --allow-env --allow-read ts2bril.ts
And then type make test.
관련 프로젝트 살펴보기
불러오는 중…