Buck2 and OCaml

Facebook just announced Buck2, a Bazel-like build system. This time it’s implemented in Rust with no builtin rules, everything is in Starlark[1]. The fun part: there’s a paragraph that uses OCaml as an example where computing dependencies dynamically is required.

Dune haters, now is your time to shine! :grin:


  1. They implemented a Starlark interpreter in rust and apparently they have a LSP for it, which to me propels it to the top of the ranking of configuration languages… ↩︎

6 Likes

I’m quite happy with Dune but you never know if there’s something better out there until you try. Well after about an hour of trying this is all I have to show and it’s still not building even though I think I’m pretty close. If you compare that mess to the different dune files in the repo you’ll see that dune is orders of magnitude simpler so I think I’ll stick with it for the time being.

If anyone else is interested in trying out buck2 I would recommend taking a look at the examples listed here.

2 Likes

<derail>
Maybe I’m the only one, but given their history in this space, I need “open source” projects from large tech conglomerates to be extraordinary or particularly novel in some way to take them seriously, and stuff from Facebook perhaps especially so.

Recall that Buck1 was announced in 2017, only to be basically abandoned in 2020. Now they’re back with Buck2…why, outside of helping with tech recruiting or keeping-up-with-the-Joneses re: bazel and comparables, I don’t know. It is just a build system after all, and a general-purpose one at that, specifically not providing any particular leverage within a given language or workflow; I see no reason to invest even 5 minutes in looking at it.
</derail>

2 Likes

I think Dune ‘haters’ have already invested so much time into other build systems (make, Bazel) that it would take a significant event to make them start over from scratch with Buck2.

I think that’s fair, honestly :-).

Although for my part, compared to Bazel, this has the advantages to:

  • not have special casing for C++ and java, which means no cheating;
  • not come from Google, which imho has worse stewardship of free software projects than Facebook;
  • be written in Rust, which means I don’t need java on my machine. Rust
    projects are generally very nice dependencies to have.

So at first glance I’d at least look at it if I wasn’t ok with dune…

2 Likes