All questions, suggestions and corrections are welcome, also for Meta’s OCaml scrips.
Why Buck 2 and not Bazel?
First: I have never tried Bazel (or the OCaml support), so I cannot say anything about it.
I’ve chosen Buck 2 because OCaml support is included by Facebook itself, the Prelude contains all language rules of Buck 2, there are no “build in” and “external” languages as with Bazel. Buck 2 is written in Rust (which I use, so no extra tooling needed to build it), Bazel in Java. And Bazel is by Google.
But I would just look at the support of each for the languages you want to/need to/must use.
Yes, this is a good idea.
The official OCaml examples (which do not use Opam packages/the ocaml-scripts) which this talk is about are located in the Buck 2 repository, in the examples subdirectory OCaml examples.
If you are just building OCaml locally: not much, you mainly lose the hidden magic Dune does (for example with modules, PPX, inline test runners, …) - if this is an advantage or disadvantage of Buck 2, you must decide for yourself ;). And if you do not use Dune, you need a .merlin file for your project’s sources, for Merlin and/or the OCaml LSP: Project configuration · ocaml/merlin Wiki · GitHub
The main advantages of Buck 2: support for many (not as much out of the box yet as Bazel) languages and distributed builds. I’m (officially mainly a C and C++ developer, and have used Makefiles (POSIX, BSD, GNU, NMake), Autoconf/Automake, IMake, CMake, QMake and some others I’ve forgotten about. I also have a bit of Typescript for some Websites and Rust and Python to build.
All supported languages (everybody can add language support there) are in the Buck 2 Prelude