OCaml on Windows

Discussion page

This is a discussion page so please add your comments below.


Linux, particularly Debian, is getting this right - it's very easy to install OCaml + PCRE + Extlib + Gtk + Dbi + PXP + Ocamlnet on Linux these days.

By contrast on Windows the situation is a lot more difficult. It's possible, just that you have to compile and install a load of stuff from all sorts of different places. The matter is complicated by the existence of three distinct Windows ports - based on MSVC, MinGW, and Cygwin respectively - all of which are officially supported by INRIA, and each of which has its own advantages and disadvantages.

Compare the situation with ActiveState and their excellent native support for Perl on Windows. I think the message is: stick with one port, and provide pointy-clicky installers for at least those important packages listed above.

The MSVC port is the best integrated with Windows, and arguably generates the best native code. However, because MSVC does not support computed gotos, the bytecode interpreter of this port is some 30% slower; this may be problematic, not least because the Windows binaries of the LablGtk distribution can currently only be used with bytecode. Another issue is that many OCaml libraries expect to be compiled with the GNU toolchain.

The Cygwin port is the closest to the Unix environment in which OCaml is most at home. It is the only Windows port to include a debugger, the only one supported by GODI, and the only one with full findlib support: this means that it can use the majority of OCaml libraries without any porting effort. However, it suffers from Cygwin's relatively poor performance, and the requirement that all distributed executables be open-source software will rule it out for most commercial developers.

The MinGW port falls somewhere in between: it is faster than the MSVC port for bytecode and faster than Cygwin for native code, and the executables it generates have no external dependencies. The previous version of this page did not even mention it; however, it may ultimately be the best compromise.

For the pragmatic OCaml developer today, the easiest environment to support is probably the MinGW port with the Cygwin toolchain. This will be hard to sell to industry, however. Full and seamless integration with Visual Studio must be a goal; VisualML provides a start, but appears not to be actively developed or supported.

MinGW port



If you want to help with the mingw port, you can see the OCaml MinGW port page : it contains proposal to improve ocaml under mingw. You can tests and propose improvements.

Dev-C++ is the kind of Mingw port

-- I've no idea. What is "Dev-C++"? Richard W.M. Jones

  Please refer to http://www.bloodshed.net/devcpp.html
  As the page mentioned, it's the kind of MinGW port 
  because it uses Mingw port of GCC as it's compiler.

Cygwin port



MSVC port