P505 will be using O'Caml for many of its assignments. Additionally, I am working on a research project called SEMINAL to improve the clarity and utility of the error messages produced by compilers, and for now O'Caml specifically. So, there are two O'Caml compilers in use for this course: the standard O'Caml compiler, and an instrumented O'Caml compiler for help with this project. Read below to see how to use both.
Feel free to email me (Ben) or Dan if you have any problems or questions.
As mentioned above, SEMINAL is a research project I am working on to improve the quality and the ease of construction of compiler error messages. We are specifically targeting compiler type errors, and our prototype works on O'Caml source. At this point, we need samples of erroneous programs to use as test cases and to evaluate our effectiveness.
As such, I am asking for your help, in volunteering your coding efforts during this course as test cases. Essentially, if you choose to use the instrumented compiler below, whenever your source code fails to compile, an anonymized version of the code (with all comments stripped out) will be copied away to a backup directory of your choosing. You can then email me the backed up source code along with your homework submissions. Participation in this project will in no way affect your performance in this course, but will help my research significantly.
To install Seminal: Follow the directions above to install a clean copy of O'Caml to your local computer. Make sure your path is set appropriately to use this local installation (especially, do not use the /uns/ installations if you use department machines). Then, set an environment variable (as appropriate for your OS) called "SEMINAL_DIR" to whatever directory you'd like, and ensure that the directory exists when running O'Caml. (On Windows, make sure this is a global environment variable rather than a per-user variable; I don't know how robust the environment sensing is in O'Caml and I know for certain it works on the global variables.) The new compilers will anonymize and copy your source program to this directory each time it fails to compile. You can then send me a zipped archive of these files when you submit homeworks. I will keep each person's sumbissions separate from each other, but will not associate your homeworks with the submissions at all.
Finally, please send me an email if you choose to participate, or if you have any questions or concerns before doing so. In the email, please tell me which OS you are using, and I will send back a precompiled binary. (Note: the source code for Seminal is not yet ready to be public, and the O'Caml license prohibits binary redistribution without the source. As such, do not redistribute this compiler. It is a research work in progress.) Take the binaries I send back, and replace the local installation you have with them. No other configuration should be needed.
In general, you will use ocaml to experiment on the fly, and ocamlc to compile an entire file at once. To exit ocaml's read-eval-print loop, either use Ctrl+D (only works on Linux boxes), or "exit 0;;" (which works anywhere).
For further information, see the man pages and part III of the system manual: http://caml.inria.fr/pub/docs/manual-ocaml/index.html