Dune The OCaml build system Jeremie Dimino, Jane Street @diml - - PowerPoint PPT Presentation

dune
SMART_READER_LITE
LIVE PREVIEW

Dune The OCaml build system Jeremie Dimino, Jane Street @diml - - PowerPoint PPT Presentation

Dune The OCaml build system Jeremie Dimino, Jane Street @diml @dimenix The history of Dune At the beginning, there was omake, ocamlbuild, ... ... then Jane Street did Jenga and the Jenga rules... ... then a domain specic tool called


slide-1
SLIDE 1

Dune

The OCaml build system

Jeremie Dimino, Jane Street

@diml @dimenix

slide-2
SLIDE 2
slide-3
SLIDE 3
slide-4
SLIDE 4

The history of Dune

slide-5
SLIDE 5

At the beginning, there was omake, ocamlbuild, ... ... then Jane Street did Jenga and the Jenga rules... ... then a domain specic tool called jbuilder... ... and nally Dune.

slide-6
SLIDE 6

What is Dune?

slide-7
SLIDE 7
  • bin/foo.exe
  • lib/foo/foo.cma
  • lib/foo/foo.cmi
  • ...
  • share/man/man1/foo.1
  • doc/foo/LICENSE.md
  • ...

Project

src/dune test/dune example/dune

(library (public_name mylib) (libraries base re lwt)) ; Custom build rule (rule (with-stdout-to m.ml (run gen/gen.exe)))

slide-8
SLIDE 8

Build system OCaml Build Logic Dune language

slide-9
SLIDE 9

Interesng Dune features

Composability Multiple build contexts

slide-10
SLIDE 10

How does it work?

slide-11
SLIDE 11

Rule producer Rule executor (scheduler+rebuilder)

slide-12
SLIDE 12

let read_dune_file fname = let contents = read_file fname in parse_dune_file fname let get_lib dir = let stanzas = read_dune_file (Path.relative dir "dune") in List.find_map stanzas ~f:(function | Library lib -> Some lib.name | _ -> None)

slide-13
SLIDE 13

Memoisaon framework

get_lib("foo/src") read_dune_file("foo/src/dune") read_file("foo/src/dune")

slide-14
SLIDE 14

The end

dune.build discuss.ocaml.org

  • pensource.janestreet.com