Skip to content

nekketsuuu/min-caml

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage (by nekketsuuu)

$ make clean
$ ./to_cartelet
$ (make arcturu) # for @arcturu
$ make byte-code

You can use Tab to autocomplete :)

If you want to print some internal expression, use

$ make debug [LEVEL=lstr]

lstr is the level of internal expression (default: Asm), which is one of the below:

Parser, Typing, KNormal, Alpha, Iter, Closure, Virtual, Simm, RegAlloc, Asm

If you forget this list, type:

$ make debuglist

You can also use debugasm, debugtest, and debugcmp. Read Makefile.

To compile raytracer, use

$ make raytracer

Use -server option when you run raytracer on the contest server.

$ make raytracer
$ cd raytracer
$ asm -format o min-rt.cat.s > min-rt.o
$ rin -i sld/contest.sld -o min-rt.ppm min-rt.o -r
$ convert min-rt.ppm min-rt.png

An educational compiler for a minimal subset of OCaml, written in ~2000 lines of OCaml. For details, see:

https://esumii.github.io/min-caml/ (Japanese Web page)

https://esumii.github.io/min-caml/jpaper.pdf (Japanese academic paper)

https://esumii.github.io/min-caml/index-e.html (English Web page)

https://esumii.github.io/min-caml/paper.pdf (English academic paper)

  1. Install OCaml (https://caml.inria.fr/) if you haven't

  2. Download (and expand) MinCaml, e.g. git clone https://github.com/esumii/min-caml.git

  3. cd min-caml/

  4. Execute ./to_x86 for x86 (or ./to_sparc for SPARC, ./to_ppc for PowerPC)

  5. make

  6. If you like, try the ray tracer

    cd min-rt/ ; make

    though it takes time because of OCaml bytecode (for testing by comparison), not MinCaml

[Updates on October 9, 2013]

[Update on July 24, 2012]

  • 32-bit x86 (with SSE2, that is, Pentium IV or later) is now supported (on Linux and Cygwin); execute ./to_x86 before make.

[Updates on September 17, 2008]

  • PowerPC is now supported (in addition to SPARC), thanks to Ms. Masuko and Prof. Asai in Ochanomizu University. You must execute either ./to_ppc or ./to_sparc before make.

  • The register allocator now uses a simpler algorithm. It omits the backtracking (ToSpill and NoSpill) in previous versions.

Releases

No releases published

Packages

No packages published

Languages

  • OCaml 63.9%
  • Assembly 13.5%
  • C 6.4%
  • Scheme 5.8%
  • C++ 5.6%
  • Makefile 3.5%
  • Other 1.3%