Live data from Hacker News

A better build system for OCaml

blog.janestreet.com

31–40 of 219 posts

Re: A better build system for OCaml

#31
post #13

The only thing worse than a complex codebase is a complex build system. I think CMake is an abomination. “Hey go learn this new language to compile this other language!”

I don't mind CMake. It's awful, but I'm already using C or C++, so the bar is set pretty low. It does do a few things right, and at least some of the things it does wrong are manageable.

I'll eat at least a bit of shit if it means I can get more than one platform's-worth of build process out of a single set of human-editable configuration files.

Re: A better build system for OCaml

#32
post #13

The only thing worse than a complex codebase is a complex build system. I think CMake is an abomination. “Hey go learn this new language to compile this other language!”

The ideas embodied in modern target-oriented CMake are worthwhile. It's all hobbled by a dreadful script language but that could be improved with sufficient motivation.

Re: A better build system for OCaml

#33
post #28

Earlier quoted context omitted.

Jenga and dune are the same thing, it was just renamed.

The blog post clearly describes them as two different systems, and how Jane Street migrated from one to another.

Yes and no. This is all spelled out in the post, but it's a little thorny.

Dune is a rename of Jbuilder (2016). Jbuilder uses Jenga (2012) configuration files.

> By 2016 we had had enough of this, and decided to make a simple cross-platform tool, called Jbuilder, that would allow external users to build our code without having to adopt Jenga in full, and would release us from the obligation of rewriting our builds in OCamlbuild [...] Jbuilder understood the jbuild files that Jenga used for build configuration.

So in 2012 it made sense for them to build Jenga, because there weren't any good alternatives - Bzl etc. didn't exist, so they couldn't have solved their problems.

And in 2016 they had open-source code they wanted others to be able build; those people didn't want to use Jenga, and JS didn't want to rewrite their builds so that they could use something else. Thus, Jbuilder was a shim so that JS could still use their Jenga builds and others could build JS' code without using Jenga. Bzl etc., even though they existed, wouldn't have solved these problems either.

Re: A better build system for OCaml

#35
post #10

I respectfully have to disagree. As Fedora packager for OCaml packages, dune's configuration is yet another one-off, with a weird Lisp syntax, hard to understand, difficult to patch. I'd far rather people stuck to using more familiar Linux build systems. As an upstream OCaml developer, the whole thing falls down the minute you need to integrate other programming languages into your build (or OCaml code into a code ba…

> This rant more or less equally applies to other language-specific build systems.

And yet those language-specific build systems are overwhelmingly winning, in pretty much every language.

> As Fedora packager for OCaml packages,...

I honestly think traditional Linux packaging is in the wrong here and the problems are essentially self-inflicted (not in the sense that individual maintainers are doing something wrong, but in the sense that the policy that traditional Linux distributions are following is inherently unsustainable. It's designed for a pre-CPAN world)

> As an upstream OCaml developer, the whole thing falls down the minute you need to integrate other programming languages into your build (or OCaml code into a code base written in another language).

True up to a point, but frankly the worst case is falling back to a terrible C-style build, and "always do terrible C-style builds in case you need to integrate with C code" is not a proposition that has much appeal.

Much as I wish the whole world would standardise on Maven or Cargo, I can't see a realistic path to there without first eliminating C, because the C people are never going to agree to follow a standard for package repositories.

Re: A better build system for OCaml

#36
post #10

I respectfully have to disagree. As Fedora packager for OCaml packages, dune's configuration is yet another one-off, with a weird Lisp syntax, hard to understand, difficult to patch. I'd far rather people stuck to using more familiar Linux build systems. As an upstream OCaml developer, the whole thing falls down the minute you need to integrate other programming languages into your build (or OCaml code into a code ba…

[deleted]

Re: A better build system for OCaml

#38
post #13

The only thing worse than a complex codebase is a complex build system. I think CMake is an abomination. “Hey go learn this new language to compile this other language!”

The ideas embodied in modern target-oriented CMake are worthwhile. It's all hobbled by a dreadful script language but that could be improved with sufficient motivation.

I think what annoys me about it the most is that for every good idea in there there's one piece of tedious crap you have to work around, one actively bad misfeature that doesn't work properly, and one terrible aspect of the awful scripting language.

(And two minor annoyances that people determined to hate CMake will never shut up about. But then, if you're determined to hate something, there are worse things than CMake to do it to! So I can't be too critical.)

Re: A better build system for OCaml

#40
post #28

Earlier quoted context omitted.

Jenga and dune are the same thing, it was just renamed.

The blog post clearly describes them as two different systems, and how Jane Street migrated from one to another.

My bad, dune is a rename of jbuilder indeed. Not Jenga. But the other reply provides more context that's important.
Post reply on HN