Elm-lang on OpenBSD

Elm logo When it comes to JavaScript, I'm the grumpy old man. I don't like it, and none of the new confusing frameworks are going to change that. That's not really fair, modern JavaScript has come a long way since the time when I initially attempted to learn Prototype and JQuery.

Still, most of my attempts at learning a JavaScript framework, so I too can build fancy pants webapps, have all failed. Recently I notice a blog post from the good people at Humio. In the post they talk about how they built the Humio web-interface using Elm. Elm is something that had been on my radar earlier, when some one at Hacker News suggested that it might be a solution, if I really dislike JavaScript so much and truly cannot figure out what Webpack/npm/Grunt and Bower is all about.

So, let's give Elm a try... and it's not available on OpenBSD. Luckily it seems to just be a big old Haskell program. A program that can be build with Cabal. Ah yes, Haskell and Cabal... Yeah I don't know either.

Anyway, how hard can it be to build. Browsing around the net suggests that the following should build Elm.

$ doas pkg_add ghc
$ doas pkg_add cabal-install
$ git clone -b 0.19.1 https://github.com/elm/compiler.git
$ cd compiler
$ rm worker/elm.cabal
$ cabal new-update
$ cabal new-configure
$ cabal new-build
$ ./dist-newstyle/build/x86_64-openbsd/ghc-8.10.3/elm-0.19.1/x/elm/build/elm/elm --version

It seems to work, now I just need to learn Elm.