All Projects → sunchao → Tiger

sunchao / Tiger

Tiger Compiler from "Modern Compiler Implementation in ML" by Andrew W. Appel

Labels

Projects that are alternatives of or similar to Tiger

Compiler Explorer
Run compilers interactively from your web browser and interact with the assembly
Stars: ✭ 9,844 (+12684.42%)
Mutual labels:  compiler
Jit Compiler
JIT compiler in Go
Stars: ✭ 70 (-9.09%)
Mutual labels:  compiler
Vab
V Android Bootstrapper
Stars: ✭ 77 (+0%)
Mutual labels:  compiler
Orange
The Orange programming language
Stars: ✭ 67 (-12.99%)
Mutual labels:  compiler
Jsweet
A Java to JavaScript transpiler.
Stars: ✭ 1,167 (+1415.58%)
Mutual labels:  compiler
Online Compiler
This is an online compiler that can compile and run C\C++ And Java Program. This online compiler is a part of my 5th semester project "RUET Online Judge" . Developed By Ashadullah Shawon
Stars: ✭ 71 (-7.79%)
Mutual labels:  compiler
Charly Vm
Fibers, Closures, C-Module System | NaN-boxing, bytecode-VM written in C++
Stars: ✭ 66 (-14.29%)
Mutual labels:  compiler
Idiolisp
A statically typed functional programming language
Stars: ✭ 78 (+1.3%)
Mutual labels:  compiler
Seeless
C IDE for iOS
Stars: ✭ 71 (-7.79%)
Mutual labels:  compiler
Ts Transform Css Modules
Extract css class names from required css module files for TypeScript
Stars: ✭ 75 (-2.6%)
Mutual labels:  compiler
Gatsby Starter Default
The default Gatsby starter
Stars: ✭ 1,154 (+1398.7%)
Mutual labels:  compiler
Seriouscode
This header file enforces Clang warnings to bu turned-on for specific flags (almost everyone, at least each one I was able to find).
Stars: ✭ 68 (-11.69%)
Mutual labels:  compiler
Lens
Language for Embeddable .NET Scripting
Stars: ✭ 71 (-7.79%)
Mutual labels:  compiler
Contracode
Contrastive Code Representation Learning: functionality-based JavaScript embeddings through self-supervised learning
Stars: ✭ 66 (-14.29%)
Mutual labels:  compiler
Delta
Programming language focused on performance and productivity
Stars: ✭ 77 (+0%)
Mutual labels:  compiler
Shaderconductor
ShaderConductor is a tool designed for cross-compiling HLSL to other shading languages
Stars: ✭ 1,146 (+1388.31%)
Mutual labels:  compiler
Akilang
A compiler for a simple language, built with Python and LLVM
Stars: ✭ 71 (-7.79%)
Mutual labels:  compiler
Rubyx
RubyX compiles ruby to binary (in ruby), hoping to be that X times faster
Stars: ✭ 78 (+1.3%)
Mutual labels:  compiler
Yapypy
Yet another Python Python
Stars: ✭ 77 (+0%)
Mutual labels:  compiler
Mini Interpreter
A Simple Scripting Language
Stars: ✭ 72 (-6.49%)
Mutual labels:  compiler

Tiger Compiler

Tiger Compiler from "Modern Compiler Implementation in ML" by Andrew W. Appel

Introduction

This is a Tiger compiler with all modules completed until Chapter 12 in the book. Basically I followed all the instructions from the book without much alternation. I also tried to adhere to the functional style as much as possible, that means, minimize the usage of mutable data structures.

Requirement

So far the compiler works with either mac or linux. Besides that, you need to have Standard ML and spim installed. Both of them can be fetched via homebrew.

Standard ML is obviously need to compile the programs. Since the compiler generates spim code, you'll need the SPIM simulator to actually run the executables.

Build

To build the compiler, simply run

make main

This will build the image using sources.cm. Note that it currently doesn't support windows.

Compile

Given a tiger source program foo.tig, to compile it, you'll need to first copy the file to the project directory, and run

make foo.spim

This will compile the file, append runtime.s to it, and generate a output SPIM program called foo.spim. Then to execute the program, run

spim -file foo.spim

If foo.spim exists, make will not overwrite it. You must remove the file before running make again.

Future Work

The second half of the book covers a lot of interesting stuff, and I'm thinking about extending the compile with the following features:

  • Garbage Collection
  • OO Features
  • Functional Features
  • Polymorphism and Type Inference
  • Optimizations
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].