Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a preamble to the tutorial to introduce domain-specific language #2954

Merged
merged 9 commits into from
Feb 14, 2025
8 changes: 7 additions & 1 deletion data/tutorials/language/1ms_02_dune.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ Dune provides several means to arrange modules into libraries. We look at Dune's

This tutorial uses the [Dune](https://dune.build) build tool. Make sure you have version 3.7 or later installed.

In the following toy project, we create an OCaml library for the World Meteorological Organization, with clouds as its subject.

We use unique terms for different elements of our project to avoid ambiguity. For instance, the directory containing the file `cloud.ml` isn't named `cloud`. A different term is used. We also use the Spanish word "nube" and the [Nahuatl](https://en.wikipedia.org/wiki/Nahuatl) word "mixtli," where both terms mean "cloud."

**Note**: The other terms we use are classifications of clouds. These include "[cumulus](https://en.wikipedia.org/wiki/Cumulus_cloud)" (fluffy), "[nimbus](https://en.wiktionary.org/wiki/nimbus)" (precipitating), "[cumulonimbus](https://en.wikipedia.org/wiki/Cumulonimbus_cloud)" (fluffy and precipitating), "[nimbostratus](https://en.wikipedia.org/wiki/Nimbostratus_cloud)" (flat, amorphous and precipitating), and "[altocumulus](https://en.wikipedia.org/wiki/Altocumulus_cloud)" (high altitude and fluffy).

## Minimum Project Setup

This section details the structure of an almost-minimum Dune project setup. Check [Your First OCaml Program](/docs/your-first-program) for automatic setup using the `dune init proj` command.
Expand Down Expand Up @@ -88,7 +94,7 @@ You can also configure your editor or IDE to ignore it too.
In OCaml, each `.ml` file defines a module. In the `mixtli` project, the file `cloud.ml` defines the `Cloud` module, the file `wmo.ml` defines the `Wmo` module that contains two submodules: `Stratus` and `Cumulus`.

Here are the different names:
* `mixtli` is the project's name (it means *cloud* in Nahuatl).
* `mixtli` is the project's name (it means *cloud* in [Nahuatl](https://en.wikipedia.org/wiki/Nahuatl)
jakubsvec001 marked this conversation as resolved.
Show resolved Hide resolved
* `cloud.ml` is the OCaml source file's name, referred as `cloud` in the `dune` file.
* `nube` is the executable command's name (it means *cloud* in Spanish).
* `Cloud` is the name of the module associated with the file `cloud.ml`.
Expand Down
Loading