[ANN] Dune Developer Preview Updates

Hi folks! :wave:

Just wanted to share some of the work the Dune has been up to lately re: the Developer Preview we announced here :slight_smile: – we’ll be using this thread to share more updates as things go.

As always, we hold our Dune Developer meetings in public and you’re more than welcome to subscribe to our public Calendar (Google, iCal)


Getting ready for the Public Beta

As we prepare for the public beta, we’re ramping up the DX interviews and ensuring the first few users will have a fun, productive experience with the developer preview.

:inbox_tray: If you signed up for the Dev Preview back in May, check your inbox for a link and instructions to schedule your DX interview with us.

Here’s a sample video (Mastodon or X) where you can see me building the Riot project on a machine that does not have OCaml installed. It is pretty neat!

Seriously, big shoutout to the Dune team at Tarides[0] and Jane Street[1] who have been doing a phenomenal job :clap: :sparkles: :camel:

So here’s what getting started with OCaml looks like today with the Dune Developer Preview as of today (August 19 2024):

  1. get dune from our binary distribution – we’ll soon make this public!
  2. run dune pkg lock in your favorite project
  3. run dune build

That’s it. No need to install anything else, Dune will see that lock file, fetch, and build all necessary dependencies.

:world_map: These are some strong step towards the OCaml Platform vision for 2026, that we are actively working towards. If you have any thoughts or feedback please let me know!

There are more improvements coming that will help remove friction to get started and creating a delightful experience. Both of these things we strongly believe will help onboard new users to the OCaml world.

Here’s a few in the works:

  • Various DX improvements – from new outputs to simplified workflows, we want to make using Dune just delightful.

  • Bundled support for dev tools (ocalmformat, odoc, lsp) – the default toolset will be available without any extra steps! just call dune fmt, and it works. No need to manually install anything else.

  • Automatic dependency locking – when building, and even on watch mode, Dune will lock your dependencies by default and keep the lock up to date.

  • Cross-project Caching – by default we’ll enabled a local Dune cache that across the system, so you never rebuild the same dependency even across projects.

  • Signed binaries with certificates of origin – we care deeply about security and want to make sure that any binary we ship will be easily verified and tracked back to its sources.

Stay tuned! :wave:

PS: here’s a longer video (Mastodon, X) showing you the setup for OCaml from zero, creating a new project, and adding a dependency, all within ~5 minutes

[0] @emillon @Leonidas @gridbugs @tmattio @maiste . Ambre Suhamy, Alpha Diallo
[1] @rgrinberg

30 Likes

This looks absolutely incredible. Congratulations to the dune team!!

4 Likes

Pretty great work!

Quick question about that. We are using opam lock at $WORK and we ran into something a bit particular about it: for recent enough packages of OCaml (3mo and less), OCaml now comes with system/arch dependent packages. Which means we need to slightly modify the lock file generated by opam for it to be portable.

Not the end of the world, but still a bit annoying.

I think I read dune is “opam free” but do you take this into account already?

2 Likes

See this thread Dune lockfiles are not cross-platform. How should we approach checking them into version control?

2 Likes

Another small DX update :sparkles:

  • the output of builds is now much easier to scan by being aligned in columns
  • and the colors look good on light themes too!

3 Likes

Hi @lthms! As @yawaramin pointed out, there’s a thread where we are discussing and gathering community inputs on how to make lockfiles work better. We hope to end up with a solution that is automated and portable, but it may take some iteration to get there! (or even work outside of lockfiles themselves)

I’d love to look at your dep graph and learn about these manual updates you’re doing, so feel free to reach out to me over discord (same username) :pray: