Skip to content

Commit 3646db5

Browse files
authored
Merge pull request #778 from ASRagab/aragab/update-installation-docs
2 parents 6cadf2e + 97abce3 commit 3646db5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/installation.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ title: Installation
55
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.
66

77
### System requirements
8+
89
- macOS and Linux are supported natively
910
- Windows is supported via WSL (https://ocaml.org/docs/ocaml-on-windows)
1011

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

7677
Create a file `hello.re` with the following content:
78+
7779
```
7880
print_endline("Hello world!");
7981
```
8082

83+
Create a file `dune-project` with the following content (check [dune.build](https://dune.build/) for latest version):
84+
85+
```
86+
(lang dune 3.6)
87+
```
88+
89+
Create an empty file `hello.opam`
90+
8191
Create a file `dune` with the following content:
92+
8293
```
8394
(executable
8495
(name hello)
8596
(public_name hello))
8697
```
98+
8799
> Note: dune uniformly uses the .exe extension to build native executables, even on Unix where programs don’t usually have a .exe extension.
88100
89101
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`.
90102

91103
Run the project (this will compile the project and run the executable):
104+
92105
```
93106
dune exec hello
94107
```
108+
95109
If you want to build only:
96110

97111
```

0 commit comments

Comments
 (0)