What are the biggest reasons newcomers give up on OCaml?

Doesn’t WSL solve these graphics issues? I thought you could run arbitrary Linux binaries on that ?

1 Like

I’m not sure anything actionable will come of this thread but I’ll give my two cents :slight_smile:

For me the main thing which I find lacking and could be improved is documentation.

Ocaml is different enough that it’s quite easy to get lost at the beginning. If you want to dedicate, let’s say a morning, to explore the language knowing nothing about it, you’ll probably fail. Which is not the case for other languages.

I’ll give an example of a bad documentation experience:

You want to find out how dealing with SQL would be in Ocaml, you find about caqti.

You go to its repo, the example doesn’t actually contain any CRUD operations :frowning:

You look for examples, see that the README points to an article/tutorial on Medium, which talks about jbuilder which then leads you into a rabbit hole, so you waste time trying to understand what this tool was and how it is related to your current problem of trying to make your demo work.

I’m interested in Ocaml enough to push through but I can easily imagine some people dropping out at this stage, which is unfortunate.

I’m not picking on caqti btw, it’s just a random example. I’ve also stumbled upon certain projects with absolutely no documentation - such a shame.

Of course, we can go read the source code, etc. But my main point is more documentation = less friction = better :slight_smile:

IMO, the Ocaml community should take inspiration from Elixir, for which its tool-chain enables generating documentation such as this:

I’m not quite sure what the documentation story of Ocaml is, and I understand the tooling keeps on improving.

Overall, I’m very happy with Ocaml, but if documentation (and maybe the related tooling) could be improved it’d be that much better!

8 Likes

Yes, WSL helps. But WSL2 uses a hypervisor for the installed VM (running Ubuntu), and assigns it its own IP address. If you install an X11 server like VcXsrc on the Windows side and hope to use it to render images from code running on Ubuntu, you’re going to run into problems with the default settings of Windows Defender Firewall and/or with their McAfee virus software. I got this to work on their systems by turning off WDF and McAfee on student’s computers. It wasn’t great. The IP address also has to be explicitly set.
This can be made to work. But they find it off-putting and their non-Honors roommate clicked a single button on python.org and everything just worked. (Granted sans student-friendly graphics libraries. Racket has a better story here, but I definitely don’t want to teach Racket, I want to introduce them to coding in OCaml.)

Maybe I’m confused, but the latest version of WLS2 might support X11 out of the box. WSL tutorial GUI apps

1 Like

@benjamin-thomas have you given this feedback to the Caqti authors, for example by opening an issue on the caqti issue tracker? (cc @paurkedal the Caqti author)

2 Likes

This is correct. It’s still using X11 (and is thus somewhat inefficient), but it does so natively.

As the maintainer of Caqti, I was very happy about the Medium article when it came, but it is somewhat outdated now. I agree, a new or rewrite of the tutorial-style documentation is needed. Not sure if you saw it, but there is a CRUD minus the “D” example, the bikereg, while the code in the README is merely to show how to use Caqti under utop. Yes, the organization of the documentation, starting at the README, needs work too.

3 Likes

No I haven’t :slight_smile:

As I said this isn’t specific to caqti. I just wanted to communicate that having tooling specifically designed to generate good documentation would probably encourage package maintainers to do more with minimal effort, and help make Ocaml look more attractive to potential new users.

Yes I did see it, this morning actually. I’ve finally been able to get a working demo which I was very happy with. :slight_smile:

I had to work on Ocaml for a few weeks, to get to this stage though.

I could contrast this with my Clojure experience, for instance, and this SQL library. Knowing nothing about Clojure (or LISP), I got a basic demo going yesterday, in just a few hours.

So of course, I know I’m comparing apples and oranges here. But still, I do want to make note of the contrast.

I’ll keep this in mind for later.

1 Like

I mean this only somewaht snarkily, but … perhaps these Windows-using students ought to learn how to install Linux on their machines ? Back in the 90s that was sort of a rite of passage for university students: you get a doorstop machine from somewhere, install Linux on it, and it becomes your “school machine”. It would teach them skills in sysadmin and all-around operations that are valuable to have for all software engineers.

4 Likes

A different answer: these students need cheap laptops. Maybe they should be buying Chromebooks instead of Windows laptops? I use a $5000 $500 Chromebook for almost all my development (and also movie-watching). It’s perfectly cromulent. HP x360 14c (4-core i5, 8GB mem, 256GB SSD). It’s got a Linux container, and you can run X-windows apps in there by default.

ETA: Whups! $500. Five Hundred. Sorry.

Answer to both questions from my personal experience as a university student: Windows is often unavoidable because other coursework uses software that specifically requires it. For example back when I was studying econometrics, our courses were using a software called EViews which as you can see is Windows or Mac only.

2 Likes

There’s dual-boot. Also Vmware is free. Lots of ways to install Linux on a Windows box. The key thing is: it takes some attention and motivation. But kids used to do it all the time back in the 90s when computers weren’t cheap and you had to make do with what you found.

2 Likes

Dual-boot can be pretty tricky to set up and VMWare would not offer a great workflow (developing in a virtual machine). Again, we are contrasting with one-click installs here like Python. Sure, back in the old days we were doing things the hard way but it’s just surprising that after more than a decade, we can’t do much better.

5 Likes

Every time this comes up (and it comes up at least once a year), I ask the obvious question: where are the hard-core Windows users who could do this work ? And it seems that they do not exist. How did Python get to where it had nice Windows support ? Maybe it’s worth looking into the history there ?

B/c if the answer is “UNIX jocks who never used Winders except under duress, need to hold their noses and touch that feculent pile of bits long enough to do this work” … well, that’s not really going to work.

Yawar, you mentioned that you used Windows in college. Why did you stop using it?

Wrong question for two reasons:

  1. You don’t need hard-core Windows users. I’m not; I’m a generalist. Yet that still hasn’t stopped me from contributing to Windows.
  2. The question presumes that *nix users can’t do anything.

What can you, as a *nix dev, do today?

  1. I released setup-dkml a while ago; among other things, it does CI testing of OCaml packages on Windows using the Microsoft compiler. There are hundreds of critical packages that are waiting for your PRs to make sure they compile successfully on native Windows.
  2. Windows does not have hardcoded paths like /usr/bin to install software; every Windows machine and user can set up their own paths. That means today that OCaml code has to be compiled on Windows PC during the install, contributing to a poor install experience. @dra27 has stepped up and is doing the work to get a relocatable OCaml compiler … that is the huge first step. But ocamlc -config is probably just the start of hardcoded paths in the OCaml ecosystem. *nix devs could be auditing other OCaml packages and removing the hardcoded paths today.
  3. If you work for a company, ask them to contribute to OCSF. That is the easiest vehicle to get critical Windows work funded.

I can probably come up with more things that can be done; message me privately if you can’t find an area to help.

And when proficient OCaml-ers complain about Windows, and yet aren’t doing anything to improve Windows, please refer them to this post.

16 Likes

In general, I think that we should write something like this to check that we are moving into the right direction about usability.

$5000 is an opposite of being cheap

1 Like

OOPS. $500. Five Hundred. Sorry.

My question made a different assumption: Unix jocks gain literally zero benefit from Windows support, b/c we never use Windows. I have run Windows in VMWare in order to run my company’s VPN, and sometimes to run Lotus Notes. That’s it. Otherwise, it was Linux (and before that, AIX). Why would I want to learn a thing about Windows – enough to even the simplest thing ? That effort and learning can go to learning more about Unix and doing a better job there.

It really does come back to having committed, really commiited Windows users, who want to see OCaml spread on the Windows platform. That’s what I mean by hard-core: people who will do hard work to improve OCaml on their platform.

When I worked for IBM, I was the DB2-Perl maintainer for a number of years: I debugging various problems with that interface and added new DB2-specific function a number of times. Without people in IBM doing that work, it wouldn’t have gotten done. And you can’t expect somebody who works with Oracle every day to do it, either, since (a) they derive zero benefit, and (b) they don’t have the experience and knowledge to do a good job.

Since I am on Windows, I have some platform specific issues. Opam packages are compiled from sources, but the Windows ecosystem makes it harder to assemble different projects (if only there was unique “apt-get source” command).

Let’s take Gtk2 and its lablgtk binding. I have installed mingw-w64-x86_64-gtk2 (on MSYS2 with pacman), but “opam install lablgtk” fails to find the “pkg-config” helper. And I can’t find it to resolve a PATH issue. (And I don’t know if the Diskuv environment, based on VS is compatible with Gtk2 based on MSYS2).

Then, having a fully integrated environnement (Java and its Swing GUI) makes things far easier.

1 Like