Skip to content

cucapra/gator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f506d64 · Jan 6, 2021
Sep 5, 2018
Aug 5, 2020
Jan 6, 2021
Dec 30, 2020
May 10, 2020
Apr 25, 2019
Jul 8, 2019
Jan 6, 2021
Dec 29, 2020
Jan 5, 2021
Dec 11, 2020
Oct 19, 2020
Jun 1, 2020
Jun 19, 2020
Nov 25, 2020
Jul 6, 2020
Jul 6, 2020
Mar 3, 2020
Jul 23, 2019
Jun 11, 2019
Oct 9, 2020

Repository files navigation

Gator

CircleCI

This is a flexible language built around geometric types for tracking the geometry of a run program. There is a compiler, pretty printer, and interpreter.

OCaml 4.08 or higher required Dune 2.5.0 or higher required

Optional Ocamlformat 0.14.2

Set Up

We need Dune and Menhir:

$ opam install dune
$ apt-get install m4  # On Debian, for example.
$ opam install menhir

Build by typing:

$ make

Now you can use dune exec bin/gatorc.bc to run the compiler. Or you can install a gatorc executable:

$ make build

Now gatorc should be available on your path.

Run

To simulate a Gator-compiled shader on your browser, view the README in the example folder.

You can run the compiler directly by passing a *.lgl source file as an argument to gatorc. For example:

$ gatorc example.lgl

To run our house interpreter, simply include the argument -i:

$ gatorc -i example.lgl

Tests

There are a bunch of tests under the test directory. Use the test.py script to run them.

Technical Details

The current version of the compiler generates GLSL 1.0 code, which is suitable for use in WebGL 1.0 (i.e., OpenGL 2.0) programs.