From 1dd112f134461100b31be70af9075ee6e6115f17 Mon Sep 17 00:00:00 2001 From: Jonah Beckford <71855677+jonahbeckford@users.noreply.github.com> Date: Sun, 23 Jul 2023 16:40:10 -0700 Subject: [PATCH] Install DkML. Set up utop --- book/install.html | 57 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/book/install.html b/book/install.html index f0dd48bc1..22908b726 100644 --- a/book/install.html +++ b/book/install.html @@ -19,16 +19,34 @@

Installation Instructions

Note that Windows is not fully supported by the examples in Real World OCaml or by opam, though it's being worked on. Until that's - ready, we recommend using a virtual machine running Debian Linux on + ready, we recommend using the + DkML Windows distribution, or + a virtual machine running Debian Linux on your local machine through WSL2, or - Docker for Windows.

+ Docker for Windows. The DkML Windows + distribution has callout sections titled Using DkML on Windows? for + easy navigation.

Let's get started.

Install and set up opam

+

Using DkML on Windows?

+ +If you use Unix (ex. macOS, Linux) you can skip this section. + +

+ opam will be installed and set up by downloading and running the + DkML 2.0.1 64-bit installer. +

+ +

+ After that, skip down to the + Set up utop for DkML on Windows section. +

+

Install opam

The easiest way to install opam is through your OS's package @@ -107,7 +125,7 @@

Install via opam

Other packages will come up in the book, but you can install them when you need them.

-

Set up utop

+

Set up utop on Unix

You should create an ~/.ocamlinit file in your home directory with the following contents:

@@ -122,6 +140,39 @@

Set up utop

pretty-printers and syntax extensions. Notice that # is used to mark a toplevel directive, not a comment.

+

Set up utop for DkML on Windows

+ +If you use Unix (ex. macOS, Linux) you can skip this section. + +

You should first create an utop configuration directory. + If you use Command Prompt to run command-line programs, run the following:

+ +

+if NOT EXIST %LOCALAPPDATA%\utop ( mkdir %LOCALAPPDATA%\utop )
+
+ +

If instead you use PowerShell to run command-line programs, run the + following:

+ +

+New-Item -Force -ItemType Directory $env:LOCALAPPDATA\utop
+
+ +

Then you should create an %LOCALAPPDATA%\utop\init.ml file if you + use Command Prompt, or create an $env:LOCALAPPDATA/utop/init.ml + file if you use PowerShell, with the following contents:

+ +

+#require "base";;
+open Base;;
+
+ +

When you save the file the "Encoding" must be +UTF-8, not UTF-8 with BOM or UTF-16.

+ +

This will open the Base standard library. Notice that # is + used to mark a toplevel directive, not a comment.

+

Set up your editor

Visual Studio Code