NOTICE: this repository is deprecated; please see the Try OCaml reboot at https://gitlab.ocamlpro.com/OCamlPro/learn-ocaml instead.
the above is in fact the version that is now depoyed to https://try.ocamlpro.com
TryOCaml is the easiest way to learn how to code in OCaml language. A funny way to learn the language. It is available here:
TryOCaml is based on (http://ocsigen.org/js_of_ocaml/files/toplevel/index.html) built with js_of_ocaml (see http://ocsigen.org/js_of_ocaml/).
$ opam remote add devel git@github.com:OCamlPro/opam-repo-dev.git
$ opam install js_of_ocaml.100
$ git submodule init
$ git submodule update
$ ./configure
$ make
Then, with your favorite browser launch tryocaml/index.html:
$ chromium-browser tryocaml/index.html
Lessons are in the "lessons/" top directory.
Each lesson is a sub-directory "lessonN", where N is the lesson number, and contains a file "lesson.html", with a title in a <h3> tag on the first line, and a set of steps. Each step is a sub-directory "stepM" of "lessons/lessonN", where M is the step number in the lesson.
Each step is composed of two files:
To recompile when you have done a modification:
$ make update-lessons
Failure to comply to the lesson/step specification will make the tryocaml/tutorial/make_lessons command fail.
If you want to debug at some point, you can type debug true in the terminal to see what the input and output strings are.
Once everything works, send a "pull request" via Github, or send us a patch. You can also come on #ocamlpro IRC channel to discuss with us.
[GNU General Public License] (https://github.com/OCamlPro/tryocaml/blob/master/tryocaml/LICENSE.GPL)