Start of topic | Skip to actions

Task: Staging Logo

Owner: Chris Warrington

Current Status

Reading and working on examples.

Goal

To implement an interpreter for turtle graphics (logo) using MetaOCaml. To get there, we'll develop systematic methods for incorporating various features into a simple language that we already know how to write a good staged interpreter for. The project will extend on ideas presented in this the Gentle Introduction to Multi-stage Programming. In particular, we will explore extending the lint language with:

  • Adding state and side effects
  • Adding IO
  • Adding exceptions and error handling
  • Adding other base types
  • Adding function types
  • Adding arrays and loops
  • Adding mutual recursion
  • Adding user-defined function types

The project will explore the use of objects, modules, and monads for structuing interpreters and staged interpreters.

Proposed Work Plan

The project would involve:
  1. Learning OCaml (see for example online book), which is a typed functional language. Recommended reading is Ch 2 (doing calculator example should be useful and fun), Ch 3, Ch 11, Ch 14-16,
  2. Reading the paper above and understanding it,
  3. Studying DrLint, a revised version of the implementation described in the paper above,
  4. Reading the Essence of Functional Programming paper to learn about monads (a powerful tool for structuring functional programs),
  5. Translate the interpreters in the above paper into OCaml,
  6. Explore how they can be restructured using the above abstraction mechanisms,
  7. Systematically exploring how a lint interpreter can be extended to handle each of the features above with each of the abstraction mechanisms listed.

Notes

I tried to install MetaOCaml to see if I could get it working before looking at the OCaml book. I ran in to a few issues:
  • When running make and -jn is specified, if n > 1, make can fail. This seems to be a bug with ocaml as well.
  • make world.opt does not seem to produce the metaocaml or metaocamlc executables. Running it "manually" (ie make world, make bootstrap, make opt, make opt.opt) does produce metaocaml and metaocamlc. Running make world after this confirms that make world.opt does not build metaocaml or metaocamlc.
  • Attached is the Gentoo ebuild file I used to install MetaOCaml on my system. If is very similar to Ingo Bormuth's ebuild.
  • Ingo Bormuth's ebuild in currently in the process of being added to the Gentoo portage tree. The entry can be found at: http://bugs.gentoo.org/show_bug.cgi?id=111407
  • If the attached ebuild works on various systems, it could be merged with Ingo's to provide users with more control over the build process (specifically, there is an option to enable building of the native compilers).
    • I don't quite understand the Latex related code in Ingo's ebuild. However, my knowledge of Latex is very limited.

Progress reports can be found on the internal Wiki


End of topic
Skip to actions | Back to top
toggleopenShow attachmentstogglecloseHide attachments
Topic attachments
I Attachment Action Size Date Who Comment
elseebuild metaocaml-308_alpha027.ebuild manage 2.4 K 17 Jan 2006 - 22:41 Main.ChrisWarrington My current Gentoo ebuild file for metaocaml
Creative Commons LicenseThis work is licensed under a Creative Commons Attribution 2.5 License. Please follow our citation guidelines.