diff --git a/data/tutorials/en/000_up_and_running.md b/data/tutorials/en/000_up_and_running.md index 7763c025ed..a4f33d9f2f 100644 --- a/data/tutorials/en/000_up_and_running.md +++ b/data/tutorials/en/000_up_and_running.md @@ -66,10 +66,10 @@ sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install. ### For Windows -We use the [OCaml for Windows](https://fdopen.github.io/opam-repository-mingw/) -installer which comes in 32bit and 64bit versions. This installer gives you -opam and OCaml installations all in one go. It is used from within a Cygwin -environment, but the executables produced have no dependency on Cygwin at all. +OCaml on Windows is still a work in progress. In the meantime, if you only +need to *run* OCaml programs on a Windows machine, then the simplest solution is to use the Windows Subsystem for Linux 2 (WSL2). WSL2 is a feature that allows Linux programs to run directly on Windows. WSL2 is substantially easier and faster to use than WSL1. Microsoft has comprehensive installation steps for [setting up WSL2](https://docs.microsoft.com/en-us/windows/wsl/install-win10). + +On the other hand, if you need Windows binaries, you will have to use the [OCaml for Windows](https://fdopen.github.io/opam-repository-mingw/) installer which comes in 32bit and 64bit versions. This installer gives you Opam and OCaml installations all in one go. It's used from within a Cygwin environment, but the executables produced have no dependency on Cygwin at all. For a more comprehensive update on the state of OCaml on Windows, see the [OCaml on Windows](/platform/ocaml_on_windows.html) page on the old version of the site. ## The OCaml top level @@ -204,6 +204,8 @@ from the list. Now, help is available by hovering over symbols in your program:  +**On Windows using WSL2**, you will remotely connect to your WSL2 instance from Visual Studio Code. Microsoft has a [useful blog post](https://code.visualstudio.com/blogs/2019/09/03/wsl2) covering getting WSL2 and Visual Studio Code connected. + **On Windows**, we must launch Visual Studio Code from within the Cygwin window, rather than by clicking on its icon (otherwise, the language server will not be found): diff --git a/src/ocamlorg_data/tutorial.ml b/src/ocamlorg_data/tutorial.ml index bf34f0bf64..7acca90f83 100644 --- a/src/ocamlorg_data/tutorial.ml +++ b/src/ocamlorg_data/tutorial.ml @@ -86,10 +86,10 @@ sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install. ### For Windows -We use the [OCaml for Windows](https://fdopen.github.io/opam-repository-mingw/) -installer which comes in 32bit and 64bit versions. This installer gives you -opam and OCaml installations all in one go. It is used from within a Cygwin -environment, but the executables produced have no dependency on Cygwin at all. +OCaml on Windows is still a work in progress. In the meantime, if you only +need to *run* OCaml programs on a Windows machine, then the simplest solution is to use the Windows Subsystem for Linux 2 (WSL2). WSL2 is a feature that allows Linux programs to run directly on Windows. WSL2 is substantially easier and faster to use than WSL1. Microsoft have comprehensive installation steps for [setting up WSL2](https://docs.microsoft.com/en-us/windows/wsl/install-win10). + +On the other hand, if you need Windows binaries then you will have to use the [OCaml for Windows](https://fdopen.github.io/opam-repository-mingw/) installer which comes in 32bit and 64bit versions. This installer gives you opam and OCaml installations all in one go. It is used from within a Cygwin environment, but the executables produced have no dependency on Cygwin at all. For a more comprehensive update on the state of OCaml on Windows, see the [OCaml on Windows](/platform/ocaml_on_windows.html) page on the old version of the site. ## The OCaml top level @@ -224,6 +224,8 @@ from the list. Now, help is available by hovering over symbols in your program:  +**On Windows using WSL2** you will remotely connect to your WSL2 instance from Visual Studio Code. Microsoft have a [useful blog post](https://code.visualstudio.com/blogs/2019/09/03/wsl2) covering getting WSL2 and Visual Studio Code connected. + **On Windows**, we must launch Visual Studio Code from within the Cygwin window, rather than by clicking on its icon (otherwise, the language server will not be found): @@ -312,10 +314,9 @@ available:
sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)
We use the OCaml for Windows -installer which comes in 32bit and 64bit versions. This installer gives you -opam and OCaml installations all in one go. It is used from within a Cygwin -environment, but the executables produced have no dependency on Cygwin at all.
+OCaml on Windows is still a work in progress. In the meantime, if you only +need to run OCaml programs on a Windows machine, then the simplest solution is to use the Windows Subsystem for Linux 2 (WSL2). WSL2 is a feature that allows Linux programs to run directly on Windows. WSL2 is substantially easier and faster to use than WSL1. Microsoft have comprehensive installation steps for setting up WSL2.
+On the other hand, if you need Windows binaries then you will have to use the OCaml for Windows installer which comes in 32bit and 64bit versions. This installer gives you opam and OCaml installations all in one go. It is used from within a Cygwin environment, but the executables produced have no dependency on Cygwin at all. For a more comprehensive update on the state of OCaml on Windows, see the OCaml on Windows page on the old version of the site.
OCaml comes with two compilers: for native code, and for byte code. We shall use one of those in a moment. But first, let's use OCaml's top level (sometimes @@ -410,6 +411,7 @@ Studio Marketplace.
toolchain in use: pick OCaml the version of OCaml you are using, e.g. 4.11.1 from the list. Now, help is available by hovering over symbols in your program:On Windows using WSL2 you will remotely connect to your WSL2 instance from Visual Studio Code. Microsoft have a useful blog post covering getting WSL2 and Visual Studio Code connected.
On Windows, we must launch Visual Studio Code from within the Cygwin window, rather than by clicking on its icon (otherwise, the language server will not be found):
diff --git a/src/ocamlorg_data/workflow.ml b/src/ocamlorg_data/workflow.ml index aabc48d297..bb04812583 100644 --- a/src/ocamlorg_data/workflow.ml +++ b/src/ocamlorg_data/workflow.ml @@ -18,8 +18,8 @@ let all = }; { title = "Updating dependencies" - ; body_md = "\n> **TL;DR**\n> \n> If the project generates the `*.opam` file from the `dune-project`, add the dependency in the `package` stanza and run `opam install . --deps-only`.\n> If the project does not generate the `*.opam` file, add the dependency in the `*.opam` file and run `opam install . --deps-only`.\nTo avoid duplicating the project configuration into multiple files, Dune allows to generate the `*.opam` file of the project from the \npackage definitions in `dune-project` when adding the `(generate_opam_files true)` stanza.\n\nHowever, opam remains a central piece of the ecosystem and it's very likely that you will have to work with `*.opam` files at some point,\nso we don't take a stance on wether you should specify your dependencies in the `*.opam` file or in `dune-project`.\n\nIf the project generates the opam file from the `dune-project` (you can tell by the line `# This file is generated by dune, edit dune-project instead` at the top of the `*.opam` file), you can add your dependencies in the `dune-project` in the appropriate `package` stanza. It should look like this:\n\n```dune\n(package\n (name demo)\n (synopsis \"A short, but powerful statement about your project\")\n (description \"An complete and exhaustive description everything your project does.\")\n (depends\n (ocaml\n (>= 4.08.0))\n dune\n (alcotest :with-test)\n (odoc :with-doc)))\n```\n\nOnce you have added your dependency, you can build your project with `dune build` which will re-generate the `*.opam` files.\n\nIf the `*.opam` files are not generated, you can add the dependencies in them directly, in the `depends` field. If should look like this:\n\n\n```opam\nopam-version: \"2.0\"\nsynopsis: \"A short, but powerful statement about your project\"\ndescription: \"An complete and exhaustive description everything your project does.\"\ndepends: [\n \"ocaml\" {>= \"4.08.0\"}\n \"dune\"\n \"alcotest\" {with-test}\n \"odoc\" {with-doc}\n]\nbuild: [\n [\"dune\" \"subst\"] {pinned}\n [\n \"dune\"\n \"build\"\n \"-p\"\n name\n \"-j\"\n jobs\n \"@install\"\n \"@runtest\" {with-test}\n \"@doc\" {with-doc}\n ]\n]\n```\n\nEither way, once you have added your dependency in the appropriate file, you can run `opam install . --deps-only` to update your current switch's dependencies.\n" - ; body_html = "\n\nTL;DR
\nIf the project generates the
\n*.opam
file from thedune-project
, add the dependency in thepackage
stanza and runopam install . --deps-only
.\nIf the project does not generate the*.opam
file, add the dependency in the*.opam
file and runopam install . --deps-only
.\nTo avoid duplicating the project configuration into multiple files, Dune allows to generate the*.opam
file of the project from the\npackage definitions indune-project
when adding the(generate_opam_files true)
stanza.
However, opam remains a central piece of the ecosystem and it's very likely that you will have to work with *.opam
files at some point,\nso we don't take a stance on wether you should specify your dependencies in the *.opam
file or in dune-project
.
If the project generates the opam file from the dune-project
(you can tell by the line # This file is generated by dune, edit dune-project instead
at the top of the *.opam
file), you can add your dependencies in the dune-project
in the appropriate package
stanza. It should look like this:
namesynopsis\"A short, but powerful statement about your project\"\"An complete and exhaustive description everything your project does.\"4:with:with\n
Once you have added your dependency, you can build your project with dune build
which will re-generate the *.opam
files.
If the *.opam
files are not generated, you can add the dependencies in them directly, in the depends
field. If should look like this:
opam-version: \"2.0\"\nsynopsis: \"A short, but powerful statement about your project\"\ndescription: \"An complete and exhaustive description everything your project does.\"\ndepends: [\n \"ocaml\" {>= \"4.08.0\"}\n \"dune\"\n \"alcotest\" {with-test}\n \"odoc\" {with-doc}\n]\nbuild: [\n [\"dune\" \"subst\"] {pinned}\n [\n \"dune\"\n \"build\"\n \"-p\"\n name\n \"-j\"\n jobs\n \"@install\"\n \"@runtest\" {with-test}\n \"@doc\" {with-doc}\n ]\n]\n
Either way, once you have added your dependency in the appropriate file, you can run opam install . --deps-only
to update your current switch's dependencies.
\n\nTL;DR
\nIf the project generates the
\n*.opam
file from thedune-project
, add the dependency in thepackage
stanza and runopam install . --deps-only
.\nIf the project does not generate the*.opam
file, add the dependency in the*.opam
file and runopam install . --deps-only
.\nTo avoid duplicating the project configuration into multiple files, Dune allows to generate the*.opam
file of the project from the\npackage definitions indune-project
when adding the(generate_opam_files true)
stanza.
However, opam remains a central piece of the ecosystem and it's very likely that you will have to work with *.opam
files at some point,\nso we don't take a stance on wether you should specify your dependencies in the *.opam
file or in dune-project
.
If the project generates the opam file from the dune-project
(you can tell by the line # This file is generated by dune, edit dune-project instead
at the top of the *.opam
file), you can add your dependencies in the dune-project
in the appropriate package
stanza. It should look like this:
namesynopsis\"A short, but powerful statement about your project\"\"An complete and exhaustive description everything your project does.\"4:with:with\n
Once you have added your dependency, you can build your project with dune build
which will re-generate the *.opam
files.
If the *.opam
files are not generated, you can add the dependencies in them directly, in the depends
field. If should look like this:
opam-version: \"2.0\"\nsynopsis: \"A short, but powerful statement about your project\"\ndescription: \"An complete and exhaustive description everything your project does.\"\ndepends: [\n \"ocaml\" {>= \"4.08.0\"}\n \"dune\"\n \"alcotest\" {with-test}\n \"odoc\" {with-doc}\n]\nbuild: [\n [\"dune\" \"subst\"] {pinned}\n [\n \"dune\"\n \"build\"\n \"-p\"\n name\n \"-j\"\n jobs\n \"@install\"\n \"@runtest\" {with-test}\n \"@doc\" {with-doc}\n ]\n]\n
Either way, once you have added your dependency in the appropriate file, you can run opam install . --deps-only
to update your current switch dependencies.