Giter VIP home page Giter VIP logo

fastlag / bril Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sampsyo/bril

0.0 0.0 0.0 5.83 MB

an educational compiler intermediate representation

Home Page: https://capra.cs.cornell.edu/bril/

License: MIT License

Shell 0.28% Python 8.07% C 33.62% Emacs Lisp 0.15% OCaml 3.69% Rust 38.61% Standard ML 0.03% Awk 0.04% TypeScript 9.53% TeX 1.51% Swift 2.63% Makefile 1.22% Vim Script 0.62%

bril's Introduction

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.

bril's People

Contributors

sampsyo avatar pat-lafon avatar avanhatt avatar tmaradc avatar kq-li avatar wbthomason avatar socrateswong avatar cgyurgyik avatar orichardson avatar checkmate50 avatar zzzdavid avatar chrisroman avatar dz333 avatar michaelmaitland avatar stp59 avatar nwtnni avatar susan-garry avatar yy665 avatar jonathandltran avatar tedbauer avatar he-andy avatar agentcooper avatar priyasrikumar avatar sanjitbasker avatar 5hubh4m avatar alifarahbakhsh avatar evanmwilliams avatar yxd97 avatar atucker avatar ankushrayabhari avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.