| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Buried in cloud files? We can help with Spring cleaning!

    Whether you use Dropbox, Drive, G-Suite, OneDrive, Gmail, Slack, Notion, or all of the above, Dokkio will organize your files for you. Try Dokkio (from the makers of PBworks) for free today.

  • Dokkio (from the makers of PBworks) was #2 on Product Hunt! Check out what people are saying by clicking here.

View
 

OCaml Notes

This version was saved 13 years ago View current version     Page history
Saved by eaburns
on June 19, 2009 at 8:34:09 am
 

OCaml

 

Objective Caml (OCaml) is a dialect of ML. You can learn more about it at the official site. You might be interested in a syntax comparison between OCaml and Standard ML.

 

A great place to start learning about OCaml is Jason Hickey's book. Some people also like ocaml-tutorial.org. Published books on ML include Ullman's Elements of ML Programming and Felleisen's Little MLer.

 

There are lots of examples at the OCaml PLEAC page.

 

See the Emacs page for tips on programming environment.

 

If you have to use vim, you may want to look at omlet.

 

Those worried about speed should check out the computer language benchmarks game (click the "show" button). Xavier Leroy, OCaml's creator, says that \"My performance goals have always been 'never more than twice as slow as C'.\"

 

You might want to subscribe to the Caml Weekly News to keep up with what's going on in the OCaml community.

 

Someone should figure out how to install and use Elkhound, GSL, and LACAML.

 

For non-emacs users: top-level history and line editing can be achieved using rlwrap.

 

OCaml at the UNH AI Group

 

On the AI group machines, OCaml binaries are in /home/rai/group/bin/x86_64-linux. ocamltop is a toplevel with many of the standard library modules (like Unix and Str) already compiled in.

 

The ocm program in that directory is useful for compiling. (Put Wheeler's .ocmrc file here as an example!)

 

The results database is a tool for storing and retrieving information from experimentation.

 

We also have a custom plotting tool called YAPP.

 

We have a local copy of the distribution documentation at /home/rai/group/bin/ocaml/htmlman/index.html. You might want to bookmark it in your browser.

 

OCaml library code

Can be found at /home/rai/group/code/.  This directory contains a set of mercurial repositories which you can clone.

If you have ssh access to one of the AI machines (see the infrastructure page) then the following command should work:


  hg clone ssh://<username>@<machine>//home/rai/group/code/<repo>

 

Additionally there is a set of shell scripts available in /home/rai/group/bin which can make your life easier:

 

clone_all.sh:

Takes one opitonal argument (a machine name), and clones all of the repositories.  If the machine name argument is omitted this script will try to clone the repositories from the local filesystem instead of ssh.

 

pull_all.sh:

Assumes that each sub-directory in the current directory is a mercurial repository, it then enters each repository and does a 'hg pull.'   If the pull shows that there are updates then the updates are performed.  If there are merges required a message is printed and merges can be done by hand.

 

check_all.sh:

Same as pull_all.sh except instead of pulling, it does 'hg incoming' to see if a pull would have any updates.

 

make_repo.sh:

Creates an empty repository in /home/rai/group/code and gives everything the correct permissions.  To use it, just run it and give it the name of the repository as the argument.

 

All of the libraries use 'ocm' to build.  Ocm is in one of the repositories, however it has a makefile which can be used to build it (ignore the warnings).

 

OCaml at the UNH CS Dept

 

OCaml is installed in ~cs980/bin on agate.cs. Documentation is at ~cs980/ocaml/htmlman/index.html.

 

OCaml at UNH CISunix

 

There is an installation at ~wri5/ocaml. The compilers are in the ocaml/bin directory there, and the documentation is at ocaml/htmlman/index.html.

 

Comments (0)

You don't have permission to comment on this page.