/RanC

a self-hosting compiler for a subset of C

Primary LanguageCMIT LicenseMIT

RanC Build Status codecov

A self-hosting compiler for a subset of C.

How to use

$ make ranc                      # bootstrap ranc
$ ./ranc > a.s <<EOF             
void printf();
int main() {
  printf("hello world\n");
  return 0;
}
EOF                              # compile C code to assembly
$ gcc -m32 a.s                   # use gcc to assemble and link into binary executable
$ ./a.out                        # run your program

How to test

$ make test

Acknowledge

Many ideas are borrowed from https://github.com/Fedjmike/mini-c.