Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
OCaml C C++ Assembly Scheme Makefile Other
branch: master
Failed to load latest commit information.
PowerPC removed extra "min-caml/" directory (sorry!)
SPARC removed extra "min-caml/" directory (sorry!)
bytemark removed extra "min-caml/" directory (sorry!)
min-rt removed extra "min-caml/" directory (sorry!)
shootout removed extra "min-caml/" directory (sorry!)
test removed extra "min-caml/" directory (sorry!)
x86 "simm13" -> "simm" in debug message (commented out) thanks to Wakita-…
LICENSE removed extra "min-caml/" directory (sorry!)
Makefile removed extra "min-caml/" directory (sorry!)
OCamlMakefile OCamlMakefile updated
README fixed links to papers in README
alpha.ml removed extra "min-caml/" directory (sorry!)
alpha.mli removed extra "min-caml/" directory (sorry!)
anchor.ml removed extra "min-caml/" directory (sorry!)
assoc.ml removed extra "min-caml/" directory (sorry!)
assoc.mli removed extra "min-caml/" directory (sorry!)
beta.ml removed extra "min-caml/" directory (sorry!)
beta.mli removed extra "min-caml/" directory (sorry!)
closure.ml removed extra "min-caml/" directory (sorry!)
closure.mli removed extra "min-caml/" directory (sorry!)
constFold.ml removed extra "min-caml/" directory (sorry!)
constFold.mli removed extra "min-caml/" directory (sorry!)
elim.ml removed extra "min-caml/" directory (sorry!)
elim.mli removed extra "min-caml/" directory (sorry!)
emit.mli removed extra "min-caml/" directory (sorry!)
fdpe05.ppt removed extra "min-caml/" directory (sorry!)
float.c removed extra "min-caml/" directory (sorry!)
gaiyou.ppt removed extra "min-caml/" directory (sorry!)
id.ml removed extra "min-caml/" directory (sorry!)
inline.ml removed extra "min-caml/" directory (sorry!)
inline.mli removed extra "min-caml/" directory (sorry!)
kNormal.ml removed extra "min-caml/" directory (sorry!)
kNormal.mli removed extra "min-caml/" directory (sorry!)
lexer.mll removed extra "min-caml/" directory (sorry!)
m.ml removed extra "min-caml/" directory (sorry!)
main.ml removed extra "min-caml/" directory (sorry!)
main.mli removed extra "min-caml/" directory (sorry!)
parser.mly for coloring by caml2html
regAlloc.mli removed extra "min-caml/" directory (sorry!)
s.ml removed extra "min-caml/" directory (sorry!)
saishuu.ppt removed extra "min-caml/" directory (sorry!)
simm.mli removed extra "min-caml/" directory (sorry!)
stub.c removed extra "min-caml/" directory (sorry!)
syntax.ml removed extra "min-caml/" directory (sorry!)
to_ppc removed extra "min-caml/" directory (sorry!)
to_sparc removed extra "min-caml/" directory (sorry!)
to_x86 removed extra "min-caml/" directory (sorry!)
tutorial-mincaml.doc removed extra "min-caml/" directory (sorry!)
tutorial-ml.doc removed extra "min-caml/" directory (sorry!)
type.ml removed extra "min-caml/" directory (sorry!)
typing.ml removed extra "min-caml/" directory (sorry!)
typing.mli removed extra "min-caml/" directory (sorry!)
virtual.mli removed extra "min-caml/" directory (sorry!)

README

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

http://esumii.github.io/min-caml/ (Japanese Web page)
http://esumii.github.io/min-caml/jpaper.pdf (Japanese academic paper)
http://esumii.github.io/min-caml/index-e.html (English Web page)
http://esumii.github.io/min-caml/paper.pdf (English academic paper)

1. Install OCaml (http://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]

- Moved from SourceForge https://sourceforge.net/p/min-caml/code/ to
  GitHub https://github.com/esumii/min-caml

- Merged the Mac OS patch by shinh
  https://twitter.com/shinh/status/322043108021907458

[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.
Something went wrong with that request. Please try again.