Giter Site home page Giter Site logo

finleymcilwaine / bril-ocaml Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 35 KB

A simple OCaml library for dealing with the "Big Red Intermediate Language", an educational IR used in Cornell's advanced compilers course CS6120.

OCaml 98.42% Standard ML 1.58%

bril-ocaml's Introduction

Bril OCaml

A simple OCaml library for dealing with the "Big Red Intermediate Language", an educational IR used in Cornell's advanced compilers course CS6120.

Why

The Bril GitHub contains an OCaml library already, why did you make this one?

The existing OCaml library has "too many" features. When it loads up a Bril program, it constructs the basic blocks for you. Moreover, it implements a lot of the features that a new student would like to implement on their own.

This library does nothing but load up Bril programs into a "raw" AST-like data structure, and that's it.

Usage

You can pin this library with opam:

opam pin add bril git://github.com/FinleyMcIlwaine/bril-ocaml#core

The command above will pin the core branch of this repo, which only has support for the "core" Bril language. If you would like to have types for the extensions mentioned in the official repository (memory, floating points, and speculative execution), you can run:

opam pin add bril git://github.com/FinleyMcIlwaine/bril-ocaml#extended

That command will pin the extended branch of this repo that has support for those features.

Once you've pinned it, you can include it in your Dune files as bril and use it just as you would any other dependency!

The main function is the Bril.from_json function, which loads a Bril program in its JSON representation into the AST provided by this library. From there, you can follow along with CS6120 and implement all the cool compiler stuff on your own!

bril-ocaml's People

Contributors

finleymcilwaine avatar

Watchers

James Cloos avatar  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.