Switch branches/tags
Nothing to show
Clone or download
esumii Merge pull request #6 from cookie-s/fix-x86-prerr_byte
fix x86 fputc arguments order
Latest commit 909a27f Jan 1, 2018
Permalink
Failed to load latest commit information.
PowerPC replaces all tabs (in *.ml* files) with 8 spaces May 2, 2017
SPARC replaces all tabs (in *.ml* files) with 8 spaces May 2, 2017
bytemark removed extra "min-caml/" directory (sorry!) Oct 10, 2013
min-rt replaces all tabs (in *.ml* files) with 8 spaces May 2, 2017
shootout removed extra "min-caml/" directory (sorry!) Oct 10, 2013
test replaces all tabs (in *.ml* files) with 8 spaces May 2, 2017
x86 fix x86 fputc calling Dec 31, 2017
LICENSE removed extra "min-caml/" directory (sorry!) Oct 10, 2013
Makefile add tests for (too) many arguments Oct 27, 2016
OCamlMakefile OCamlMakefile updated Oct 10, 2013
README - revert unnecessary changes (of whitespace, indent, etc.) Oct 28, 2016
alpha.ml replaces all tabs (in *.ml* files) with 8 spaces May 2, 2017
alpha.mli removed extra "min-caml/" directory (sorry!) Oct 10, 2013
anchor.ml replaces all tabs (in *.ml* files) with 8 spaces May 2, 2017
assoc.ml replaces all tabs (in *.ml* files) with 8 spaces May 2, 2017
assoc.mli removed extra "min-caml/" directory (sorry!) Oct 10, 2013
beta.ml replaces all tabs (in *.ml* files) with 8 spaces May 2, 2017
beta.mli removed extra "min-caml/" directory (sorry!) Oct 10, 2013
closure.ml replaces all tabs (in *.ml* files) with 8 spaces May 2, 2017
closure.mli replaces all tabs (in *.ml* files) with 8 spaces May 2, 2017
constFold.ml replaces all tabs (in *.ml* files) with 8 spaces May 2, 2017
constFold.mli removed extra "min-caml/" directory (sorry!) Oct 10, 2013
elim.ml replaces all tabs (in *.ml* files) with 8 spaces May 2, 2017
elim.mli removed extra "min-caml/" directory (sorry!) Oct 10, 2013
emit.mli removed extra "min-caml/" directory (sorry!) Oct 10, 2013
fdpe05.ppt removed extra "min-caml/" directory (sorry!) Oct 10, 2013
float.c updates for latest OCaml Oct 15, 2016
gaiyou.ppt removed extra "min-caml/" directory (sorry!) Oct 10, 2013
id.ml removed extra "min-caml/" directory (sorry!) Oct 10, 2013
inline.ml replaces all tabs (in *.ml* files) with 8 spaces May 2, 2017
inline.mli removed extra "min-caml/" directory (sorry!) Oct 10, 2013
kNormal.ml replaces all tabs (in *.ml* files) with 8 spaces May 2, 2017
kNormal.mli removed extra "min-caml/" directory (sorry!) Oct 10, 2013
lexer.mll replaces all tabs (in *.ml* files) with 8 spaces May 2, 2017
m.ml removed extra "min-caml/" directory (sorry!) Oct 10, 2013
main.ml replaces all tabs (in *.ml* files) with 8 spaces May 2, 2017
main.mli removed extra "min-caml/" directory (sorry!) Oct 10, 2013
parser.mly parser: give IN lowest priority (s/r conflicts: 14 -> 0) Jun 3, 2017
regAlloc.mli removed extra "min-caml/" directory (sorry!) Oct 10, 2013
s.ml removed extra "min-caml/" directory (sorry!) Oct 10, 2013
saishuu.ppt removed extra "min-caml/" directory (sorry!) Oct 10, 2013
simm.mli removed extra "min-caml/" directory (sorry!) Oct 10, 2013
stub.c removed extra "min-caml/" directory (sorry!) Oct 10, 2013
syntax.ml removed extra "min-caml/" directory (sorry!) Oct 10, 2013
to_ppc add tests for (too) many arguments Oct 27, 2016
to_sparc add tests for (too) many arguments Oct 27, 2016
to_x86 add tests for (too) many arguments Oct 27, 2016
tutorial-mincaml.doc removed extra "min-caml/" directory (sorry!) Oct 10, 2013
tutorial-ml.doc removed extra "min-caml/" directory (sorry!) Oct 10, 2013
type.ml removed extra "min-caml/" directory (sorry!) Oct 10, 2013
typing.ml replaces all tabs (in *.ml* files) with 8 spaces May 2, 2017
typing.mli removed extra "min-caml/" directory (sorry!) Oct 10, 2013
virtual.mli removed extra "min-caml/" directory (sorry!) Oct 10, 2013

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

[FAQ 1] Is there an x86_64 version?

[A] There is, but it is left as an exercise for students and _not_
included in this distribution.

[FAQ 2] Is there a version that emits C code?

[A] See above.

[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.