[ANN] MlFront - A Java-like package system for OCaml

There is now a new library MlFront_Top with a build tool mlfront-top that will generate self-contained OCaml toplevel script files with parallelism based on @c-cube’s moonpool library:

  .
  ├── AcmeWidgets_Std/
  │   ├── JobsA1.ml
  │   └── JobsA2.ml
  └── BobBuilder_Std/
      └── JobsB.ml
$ mlfront-top -o buildscript.ml

$ ocaml buildscript.ml -j 2 -native
  legend: -> start | <- finish
     directory create: target/
     file create: target/AcmeWidgets_Std.ml
     link create: AcmeWidgets_Std/JobsA1.ml -> target/AcmeWidgets_Std__JobsA1.ml
     link create: AcmeWidgets_Std/JobsA2.ml -> target/AcmeWidgets_Std__JobsA2.ml
     link create: BobBuilder_Std/JobsB.ml -> target/BobBuilder_Std__JobsB.ml
  -> compile: AcmeWidgets_Std.JobsA1
  -> compile: AcmeWidgets_Std.JobsA2
  <- compile: AcmeWidgets_Std.JobsA1
  <- compile: AcmeWidgets_Std.JobsA2
  -> compile: AcmeWidgets_Std
  <- compile: AcmeWidgets_Std
  -> compile: BobBuilder_Std.JobsB
  <- compile: BobBuilder_Std.JobsB
  -> executable create: BobBuilder_Std.JobsB
  <- executable create: BobBuilder_Std.JobsB
  done.

$ target/BobBuilder_Std.JobsB
I am an A1!
I am an A2!
I am a B!

It requires the ocaml binary and ocamlc or ocamlopt. The complete example is at tests/MlFront_Top/jobs.t/run.t · 0.4.0-6 · DkML / Build Tools / MlFront · GitLab.

1 Like