Skip to content

Commit

Permalink
Merge pull request #778 from ASRagab/aragab/update-installation-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
davesnx authored Oct 10, 2024
2 parents 6cadf2e + 97abce3 commit 3646db5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: Installation
This page is a detailed explanation on how to install Reason with [opam](https://opam.ocaml.org/), both manually and using a template. There are other options available, such as [esy](https://esy.sh), but we recommend using opam for the best experience. Check the [esy installation page](installation-esy.md) if you want to use esy instead.

### System requirements

- macOS and Linux are supported natively
- Windows is supported via WSL (https://ocaml.org/docs/ocaml-on-windows)

Expand Down Expand Up @@ -74,24 +75,37 @@ opam install dune
To wrap up the installation process, let's create a simple hello world project. With the basic setup done:

Create a file `hello.re` with the following content:

```
print_endline("Hello world!");
```

Create a file `dune-project` with the following content (check [dune.build](https://dune.build/) for latest version):

```
(lang dune 3.6)
```

Create an empty file `hello.opam`

Create a file `dune` with the following content:

```
(executable
(name hello)
(public_name hello))
```

> Note: dune uniformly uses the .exe extension to build native executables, even on Unix where programs don’t usually have a .exe extension.
The `executable` stanza is used to define executables and the `name` field is used to specify the name of the executable (Can run with `dune exec src/hello.exe`). The `public_name` field is used to specify the name of the executable when it is installed and allows you to run the executable with `hello` directly: `dune exec hello`.

Run the project (this will compile the project and run the executable):

```
dune exec hello
```

If you want to build only:

```
Expand Down

0 comments on commit 3646db5

Please sign in to comment.