Threads for strongly-typed

  1. 6

    I’m building a keyboard layout analysis and generation tool. The engine is mostly complete so I’m spending more time working on the UI this weekend.

    1. 6

      OCaml is a very pretty language, and surprisingly practical to boot. I find it easier to write performant code in than most other high-level languages. Overall, the community is helpful and full of smart people.

      Unfortunately it’s in a similar situation to Java where the tooling around it is pretty crufty, and the community is actively hostile if you point this out. If you ask the average enterprise Java programmer, they’ll say Maven and Gradle are fine, and it’s actually NPM and Cargo that suck. If you ask an OCaml programmer, they’ll say all the other language package managers are either worse, or just straight crap. That’s verbatim.

      The situation is improving, but beware that many libraries are essentially research prototypes. Because they’re written by researchers. For example, the most popular HTTP library had poor performance from 2015 until this year.

      There’s also a strange situation where the community is split between multiple I/O frameworks, Async and Lwt. Each has its own subtleties; maybe the situation has changed, but a few years ago I had to regularly refer to the actual source code to figure out how e.g. lower-level errors would be handled because this wasn’t documented.

      For tooling, people have started using esy, which is an NPM-like wrapper around OPAM. It’s a definite UX improvement. The dune build system is also a great improvement, and it looks like in the past few years the community has started caring more about practical problems like distributing OCaml code to non-OCaml users, e.g. by documenting how to statically link things

      If it wasn’t obvious, I ran into all four of these issues previously while trying to use OCaml for a project: package management, Lwt/Async subtleties, serving HTTP, and distribution.

      1. 4

        Just a nitpick, your “actively” hostile link is from 2016.

        1. 4

          And it is two people saying something?

          Yes, OPAM isn’t great. Back when it came out it was fine and indeed kickstarted the revival of OCaml. Over the years a lot of improvements have been implemented, which leads to a number of kludges in its UI. People working on it are aware of it and there are plans for a revised version learning lessons from OPAM and other package managers but it’ll be a bit of a process.

          1. 1

            Has anything come out of the discussions to make a cargo-like tool to integrate dune and opam? I remember reading something about it on the forums and I took a look at drom a while ago but I haven’t been following the discussions since. I just use OCaml for a couple personal projects so I always forget how to set up opam switches when I get back to those projects…

            1. 1

              There are some discussions how OPAM 3 could look like and how it will integrate with dune will be definitely part of the considerations.

              But as of actually existing software that could be used today? Not yet.