Kinds of shared libraries with dune and melange
  • Reason 93.7%
  • Makefile 2.6%
  • OCaml 2.3%
  • Dune 1.4%
Find a file
2025-07-29 14:21:10 +02:00
.github Remove format-check and co 2025-07-28 17:43:25 +02:00
packages Make library using shared libs, depend on all of them 2025-07-29 14:21:10 +02:00
.gitattributes Start the recollection 2025-07-28 16:16:46 +02:00
.gitignore Start the recollection 2025-07-28 16:16:46 +02:00
.ocamlformat Start the recollection 2025-07-28 16:16:46 +02:00
client.ml Pretty output 2025-07-28 17:42:02 +02:00
dune Pretty output 2025-07-28 17:42:02 +02:00
dune-project Make documentation with shared libs 2025-07-29 13:00:47 +02:00
Makefile Make documentation with shared libs 2025-07-29 13:00:47 +02:00
melange-dune-library-examples.opam Start the recollection 2025-07-28 16:16:46 +02:00
README.md Document better and remove deps 2025-07-28 17:37:57 +02:00
server.ml Run callbacks 2025-07-28 17:54:02 +02:00

Kinds of shared libraries with dune and melange

This repository demonstrates various patterns and implementations for creating shared libraries with dune and melange. It's a collection of minimalistic but real-world examples, extracted and adapted from server-reason-react repo.

Pure library

  • Same implementations: singular files
  • No dependencies aside from Stdlib

A (melange+native) library depending on a (melange+native) library

  • Same implementation: singulgar file
  • Dependency from a shared library

Same interface with different implementations

  • Different implementations, separate modules (URL.re, URL.melange.re)
  • Different dependencies (uri, melange.js)
  • Same URL.rei

A library with different implementations and different interfaces with dependencies

  • Different implementations, separate modules (Promise.re, Promise.melange.re)
  • Different dependencies (lwt, melange.belt melange.js)
  • Different preprocess (lwt_ppx, melange.ppx)
  • Different interface (Promise.rei, Promise.melange.rei)