###################################################################### An ``OCaml`` toplevel (terminal) embedded online (Try OCaml version) ###################################################################### .. include:: .javascript.en.rst ------------------------------------------------------------------------------ .. seealso:: I recommend the following, more modern and comprehensive tools! - `BetterOCaml.ml `_ is a good little OCaml editor (with the code on the left, the output of its execution on the right), developed by `a CPGE MP* student `_ in 2020) ; - `TryOCaml.OCamlPro.com `_ is another good environment to use the basic OCaml system online, without installing anything!It's done by OCamlPro and the "official" solution ; - `Learn-OCaml `_ is a heavier and more complete environment. Not sure if it works entirely offline. .. seealso:: Locally use an OCaml editor and interpreter? It is possible on this site! Without having to install anything! `BetterOCaml `_ is a simple OCaml console and editor, but one that works online without the need for a server that computes your code behind: everything is interpreted in javascript in your browser!I host a local copy here: `BetterOCaml `_. It is also on `ocaml.besson.link `_. The terminal ------------ .. raw:: html

Try OCaml

OCaml is a strongly typed functional language. It is concise and fast, enabling you to improve your coding efficiency while producing code with higher quality.

Type lesson 1 to start the tutorial.
(click on the code to insert)
lesson 1 Simple Expressions
lesson 2 Imperative Programming
lesson 3 Functions
lesson 4 Pattern Matching
lesson 5 Syntax Traps
lesson 19 The Graphics module
lesson 20 New Features in 3.12.1

      
#
CommandsEffects
Enter / Return Submit code
Up / DownCycle through history
Shift + EnterMultiline edition
lesson 1 Move to lesson 1
step 1 Move to step 1 of the current lesson
lessons () See available lessons
steps () See available steps in the current lesson
.. image:: .ocaml-powered.png :scale: 140 % :align: center :alt: OCaml powered :) :target: http://Caml.Inria.fr ------------------------------------------------------------------------------ .. seealso:: Simple OCaml Toplevel The page ``_ embeds a simpler ``OCaml`` terminal, less up-to date, but which has the advantage of being easier to include (a single Javascript file, `<_static/toplevel.js>`_, and no CSS tweaks). Hosting ------- The **Javascript** scripts used on my web pages are now stored on this *git* repository : `lbesson/web-sphinx-scripts `_, on **bitbucket.org**. Copyrights ---------- * **OCaml** is © and ® Inria; * **Try OCaml** is © and ® OCaml Pro. Acknowledgements ---------------- * First, thanks to the authors of **TryOCaml** (`try.ocamlpro.com `_). The reference page for this project is `GitHub.com/OCamlPro/tryocaml `_. * Thanks to the authors of **js_of_ocaml** (see ``_). * Thanks to the authors of **OCaml** (see ``_). .. (c) Lilian Besson, 2011-2021, https://bitbucket.org/lbesson/web-sphinx/