Arto's Notes re:
OCaml
Version Compatibility
Here concerned only with source-code compatibility between major releases of the OCaml compiler, not with other enhancements that may be provided by newer releases.
- 4.01 in comparison to 4.02+:
- There is no
Bytesmodule. Workaround:module Bytes = String. - There is no
bytestype. Workaround:type bytes = stringor useBytes.t. - Module aliases don’t work in interface files.
- Catching exceptions directly in match clauses is not supported.
- There is no
Reference
Problems
Downcasting Objects
- http://comments.gmane.org/gmane.comp.lang.ocaml.beginners/769
- https://groups.google.com/forum/#!msg/comp.lang.ml/ufGfsz0_9oQ/dMtCONswLmwJ
- http://caml.inria.fr/pub/ml-archives/caml-list/2002/05/a6520926c4eac029206a31d6aa22f967.fr.html
Interactive
$ utop
Performance
- http://www.ffconsultancy.com/languages/ray_tracer/comparison.html
- https://ocaml.org/learn/tutorials/performance_and_profiling.html
Installation
macOS with Homebrew
brew install ocaml --with-flambdabrew install opamopam initopam switch 4.02.3
Ubuntu 14.04
sudo apt-add-repository ppa:avsm/ppasudo aptitude updatesudo aptitude install ocaml-nox opamopam initeval `opam config env`opam switch 4.02.3eval `opam config env`
Packages
opam install coreopam install utopopam install ocp-indentopam install asyncopam install yojsonopam install core_extendedopam install core_benchopam install cohttpopam install async_graphicsopam install cryptokitopam install menhiropam install ctypes ctypes-foreignopam install cmdlineropam install gg
Notes
Books
- Real World OCaml by Yaron Minsky, Anil Madhavapeddy, and Jason Hickey [2013] (examples)
Tutorials
- https://ocaml.org/learn/tutorials/
- http://learnxinyminutes.com/docs/ocaml/
- http://try.ocamlpro.com/ https://github.com/OCamlPro/tryocaml
- https://github.com/caiorss/Functional-Programming/blob/master/ocaml/README.md
References
Mailing Lists
Interop with C++
- http://lists.xenproject.org/archives/html/mirageos-devel/2014-05/msg00062.html
- https://github.com/ocamllabs/ocaml-ctypes/issues/187
- http://blog.shaynefletcher.org/2014/02/extending-ocaml-in-c-boostdate-time.html
- http://l-lang.org/blog/Incorporating-C-code-in-an-Ocaml-project-using-Ocamlbuild/