Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A C-alternative language, just like C--
Haskell Objective-C C Other
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
cal
haskell
rts
vim
.gitignore
NOTES.markdown
README.markdown

README.markdown

CaLang

An C-alternative language.

Mobai Lunba

Description

Inspired by SPJ's C-- I started to think about writing something similar.

Feature

  • A working x86_64 code generator

    • Uses GAS for assembling and linking.
  • Has runtime support for GC root stack scanning.

    • Implemented by closely following Andrew W. Appel's Modern Compiler Implementation in ML (AKA the tiger book).
    • That is, it has zero runtime cost when gc is not triggered.
  • Supports TCO

    • Even when there are too many arguments. E.g., CaLang has its own (not compatible with C when passing argument by stack) calling convention.
  • C interoperability

    • In SysV, function that has no greater than 6 arguments is compatible with C.

Feature that should be implemented in the future

  • Should apply some optimizations.

    • Welp..
  • Should support runtime interface for debugging

    • GDB/DWARF?
  • Should support more platforms

    • Adding a code generator for MIPS should be pretty straightforward. In this way, students studying COMP180 can have a better time...
Something went wrong with that request. Please try again.