Question

I am reading https://realworldocaml.org/ (which is an amazing book by the way) and all of the examples assume use of the Jane Street Core library. I am not yet familiar with the OCaml environment and would like to follow this book on my Windows laptop - without getting bogged down in the details is there a simple way to get these libraries running on Windows? An answer to this question would probably help many people who would like to get started with these libraries on Windows. If not then maybe this book is good enough to persuade me to switch OS ;)

Edit - just found out that there is no support for now but that it's being worked on. Is there any rough timeline for that?

Was it helpful?

Solution

I would suggest that you use a virtual machine such as VMware Workstation, Windows Virtual PC, or Oracle Virtual Box.

You can get a Virtual Appliance with the OS installed and ready to run for many Linux OSs.

I personally have been using VMware for decades and run OCaml on Debian on VMware workstation.

Supplement

Since someone just upvoted this and I didn't recall the question I re-read it. Good thing because there is probably a better way to do this on Windows, but I have not checked it out, but will outline what I would do/ do do. :)

Install WSL (Windows Subsystem for Linux) AKA Bash on Ubuntu on Windows. This will allow you to run an Ubuntu environment on Windows without needing a virtual machine.

Next install OCaml on WSL by following the Ubuntu instructions.

Then follow the Ubuntu Linux install instructions for Real World OCaml.

Since WSL is not intended for use with a GUI, (but it is done often), use Visual Studio Code with the OCaml extension installed on Windows.

So the project directory with files and Visual Studio Code will be on the Windows file system and the OCaml environment will be on the Linux file system under WSL.

To use the files on the Windows file system from WSL just use a symbolic link.

Sorry for the terse explanation, but it is better than not knowing.

OTHER TIPS

The book instructs you to use OPAM to install the environments like utop and Jane Street Core, but OPAM still does not work in Windows yet today.

I believe Jane Street guys never run OCaml programs in Windows either, so even if OPAM is ported to Windows, it is very unlikely that Core could work in Windows smoothly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top