Installing OPAM and OCaml
A method we found recently that could allow for a nicer editor and easier installation would be to configure VSCode for use with OCaml. Instructions for installing and configuring VSCode can be found here.
You need to have a Unix development environment (this is the terminal on MacOs or Linux) with a working installation of OPAM, the OCaml Package Manager, version 2.x. You have a choice: you can install these on your own operating system, or you can download a Linux virtual machine (VM) that we provide.
- For Linux or Mac OS X, we suggest trying a native installation first. If that doesn’t work out, install the VM instead.
- For Windows, we suggest trying a WSL2/Ubuntu installation first. This is a new and experimental possibility; it has not been used in this class before this year. It’s made possible this semester by some advances that Microsoft has recently made with integration of Linux and Windows. We hope it works out, but please bear in mind that it’s new to the course staff, so we might not have all the answers right away. If it doesn’t work out, you can still use the VM, which is what we’ve recommended in the past for Windows. Why it's a good idea: If you're a computer scientist, then you should really have access to a Linux machine for software development. If what you own is a Windows box, then WSL2 with Ubuntu gives that Linux machine, on your own computer.
Regardless of what you choose, once you get an installation working keep it working throughout the semester by being cautious about any updates you apply to your system. Don’t perform any major OS upgrades just before an assignment is due, for example.
You can use any text editor you would like, but many editors have extensions that provide syntax highlighting, type checking and evaluation inside the editor. See our page on text editors to install here
These OCaml set-up notes come in part from Dexter Kozen, Nate Foster and Arjun Guha, as well as the Cornell Cos 3110 page found at https://www.cs.cornell.edu/courses/cs3110/2020sp/install.html, though there were a number of changes for us here at Princeton (don't blame them!! :-) )