Launching the First-Class Windows Project

by Sudha Parimala and Isabella Leandersson on May 22nd, 2024

We want to make learning and using OCaml easier for more people. Realising this goal involves expanding OCaml support to where the users are and making their experience smooth and hassle-free.

It is generally accepted that the current state of OCaml on Windows is not comparable to other popular platforms like Linux and macOS. This is the case even though Windows is the preferred platform for 60% of developers and the platform that around 33% of visitors use! To address this misalignment, we are launching a new project called the First-Class Windows Project.

Why Windows?

If the above statistics are not compelling enough, consider that the Windows platform accounts for around 73% of laptop/desktop installations and around 97% of PC gaming. What this tells us is that for many people around the world, Windows is the platform that they are most familiar with. It follows that if we make it easier to use OCaml on Windows, we open up the language to an influx of new users.

These include independent developers who may only be comfortable with the Windows platform, large organisations that can't easily switch their operating system, and several teaching institutions that may use Windows as the default OS for their students.

Long- and Short-Term Goals of the Project

The long-term goal is to make Windows a 'first-class' citizen among OCaml platforms, meaning that we deliver an OCaml development experience that matches Linux and macOS. This ambitious project is split into two parts: technical work encompassing the compiler, build tools, development environments, community packages, and set-up tools, alongside advocacy work centred around communication and community collaboration. We need to collaborate closely with the community to not only create the best technical solutions but also be transparent about how they are prioritised and why.

To this end, our first port of call will be to deliver a roadmap outlining the steps necessary to fully support OCaml on Windows. This roadmap needs to be based on real data and insights from users and reviewed by the OCaml community to ensure it matches the needs of the wider ecosystem. We aim to go beyond "just works" to provide a top-notch developer experience on Windows. For this, we intend to take the following approach.

Creating a Roadmap

Is OCaml Windows yet? We have made significant progress towards a better OCaml experience on Windows with Opam 2.2, adding native Windows support. Furthermore, the 5.3 release later this year will restore MSVC ports to the compiler.

But there's more work to do! Our first mission is to craft a precise list of tasks collaboratively with OCaml community members and commercial users. This will help us prioritise areas of development in the best way. Tarides has the resources to lead this work as we do extensive work on the OCaml compiler, develop many of the platform tools, and lead the CI for the community. Combining our knowledge with that of the community, we have all the components needed to succeed.

To get us started, we have identified five steps required to create our roadmap:

  1. Document the current state of OCaml on Windows
  2. Survey the community and commercial users
  3. Survey Windows support in other languages
  4. Review package managers and installation software for Windows
  5. Publish review results and produce a roadmap

Document the Current State of OCaml on Windows

There are several open-source alternatives available for installing OCaml on Windows machines. Each comes with its own challenges. We expect that the release of opam 2.2 will alleviate some, but it is not a silver bullet.

Another factor we need to address is that the current system is deeply tied to Unix-based scripting, necessitating a Unix layer on Windows for OCaml to function. At present, Cygwin provides this layer, and there's no plan to change that anytime soon. However, as part of this project, we also want to implement native Windows support and remove the Unix layer.

Against this background, step one aims to understand the state of current Windows solutions in OCaml and evaluate their effectiveness. Having this baseline is crucial for any future improvements.

Survey the Community and Commercial Users

To coordinate the efforts of many individuals and organisations and enable knowledge sharing, we will set up a working group composed of representatives with different interests. This group will be open and meet regularly to take stock of challenges and progress towards solutions. There are multiple ways to use OCaml on Windows, and different groups of users congregate around different workflows. We want to get as much information from these users as possible, and we mustn't section off these discussions in silos.

We have also published a survey for OCaml users on Windows as another way to understand user experience. We will publish the results of this survey and details on the working group soon.

As a personal aside, I (Sudha) was oblivious to many ways to use OCaml on Windows merely because I had never tried to use OCaml on a Windows machine. This changed when we had to help participants set up OCaml on Windows machines at our OCaml Workshop at the IndiaFOSS conference. Adding to our woes, the venue's WiFi was not great, making it even harder to install WSL. We had to finally resort to using an online REPL (replit).

Survey Windows Support in Other Languages

OCaml developers tend to disproportionately favour Unix-based systems, and according to the 2020 OCaml User Survey, only 11% of the respondents programmed on a Windows machine. Over time, this has led to the compiler and applications being optimised for Unix-based systems. Furthermore, the lack of testing on Windows contributes to a subpar experience on the platform. Our goal is to provide a native Windows experience; to do so, we need to account for any bias that may be present due to a lack of experience with OCaml on Windows.

To correct bias and explore best practices, we intend to study other languages that have excellent Windows support, such as Rust and Go, and languages native to Windows, such as C# and F#. Interestingly, similar efforts have been made in languages like Rust to get the UX and performance on Windows on par with Unix environments. We hope lessons from the past will help us chart an informed path for OCaml.

Review Package Managers and Installation Software for Windows

As part of this project, we will evaluate the feasibility of moving from a Unix-centric approach to Windows-native components. To do so, we will prototype the packaging of the OCaml platform using the following systems: the OCaml compiler distributed via VCPKG, an Opam repository with some selected external dependencies (depexts) migrated to VCPKG, and Opam available via Winget. This exploration will help us gain information and experience before crafting a solution.

Publish Review Results and Produce a Roadmap

We will display the results of our review efforts on a page titled "Is OCaml Windows yet?", similar to "Is OCaml Web Yet". The page will also host the roadmap and be regularly updated so that visitors get an accurate and current status of the project.

We Want Your Input!

The success of this project depends on input from the OCaml community. We need to build a picture of what works and what doesn't, not just in OCaml but in other languages. These pain points and best practices will then inform the roadmap we create, and your feedback is critical to ensure we can make the Windows developer experience in OCaml as good as possible!

If you want to share something regarding Windows or anything else about this project, please contact us on our website and let us know your thoughts. You will find updates on the project on the OCaml Discuss forum, as well as on our X page (formerly known as Twitter) and LinkedIn.