dune
domainslib
dune | domainslib | |
---|---|---|
27 | 4 | |
1,536 | 161 | |
1.0% | 0.0% | |
9.9 | 5.8 | |
5 days ago | 2 months ago | |
OCaml | OCaml | |
MIT License | ISC License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
dune
-
Tagging OCaml packages
If you are using the dune build system, add the tag(s) to your dune-project file's package stanza. E.g.:
-
NextJS, the App Router and ReasonReact
One way to get around this is to modify the api/dune file with (include_subdirs qualified); this means that every subdirectory of api/ can be referenced by module namespacing and we don't have to write dune files for every route (or pages) folder. However, the OCaml LSP does not like it and red squiggles will show up in the editor (although the app with still compile without errors). Trying to develop the app knowing those red squiggles cannot be vanquished would drive me nuts, so instead of using (include_subdirs qualified) I just wrote dune files for every route (and page) which gets rid of the red squiggles.
-
Generating .ml test cases from a glob of text files in a directory using dune
2) Neither would having all source/targets specified, as that would entail listing them all in the dune file as wildcard rules is apparently still not a thing: https://github.com/ocaml/dune/issues/307
-
Dune build
There is a small example on the dune home page: https://dune.build/
- The YAML Document from Hell
-
Ask HN: Programs that saved you 100 hours? (2022 edition)
Dune (https://dune.build/) is the preeminent build tool for OCaml development. I don't love its input syntax (s-expressions), and I sometimes miss the ability to write high-level functions to reduce boilerplate (especially for unit tests), but it always gets the dependencies right, and it's fast. This is in stark contrast to some of my experiences with various other build systems, and I am super happy that the default option for OCaml build systems is so good.
- Help getting started with Ocaml
-
Faster Incremental Builds with Dune 3
It's still weird because dune's own site only makes Jane Street references: https://dune.build/.
-
How to print anything in OCaml
ONE of the big benefits of OCaml is its powerful REPL (also called the toplevel), the interactive command-line utility where you can load modules, type in and execute code, and see its results. The modern REPL, utop, has powerful auto-completion and integration with the build system dune, which enables productive workflows like loading an entire project's libraries in the REPL and interactively exploring them.
- Dune 3.2.0
domainslib
-
OCaml 5.0 Alpha Release
For nested parallel computations (think Scientific Programming, where one would use OpenMP, Rust Rayon, etc), we have domainslib [1]. Eio, a direct-style, effect-based IO library is pretty competitive against Rust Tokio [2]. The performance will only get better as we get closer to the 5.0 release.
[1] https://github.com/ocaml-multicore/domainslib
[2] See the http server performance graphs at https://tarides.com/blog/2022-03-01-segfault-systems-joins-t...
-
PR to Merge Multicore OCaml
1. Domains are the unit of parallelism. A domain is essentially an OS thread with a bunch of extra runtime book-keeping data. You can use Domain.spawn (https://github.com/ocaml-multicore/ocaml-multicore/blob/5.00...) to spawn off a new domain which will run the supplied function and terminate when it finishes. This is heavyweight though, domains are expected to be long-running.
2. Domainslib is the library developed alongside multicore to aid users in exploiting parallelism. It supports nested parallelism and is pretty highly optimised (https://github.com/ocaml-multicore/domainslib/pull/29 for some graphs/numbers). The domainslib repo has some good examples: https://github.com/ocaml-multicore/domainslib/tree/master/te...
3. We've not tested against other forms of parallelism. There isn't anything stopping you exploiting SIMD in addition to parallelism from domains.
4. No, we've not compared performance by OS.
5. No plans for the multicore team to look at accelerator integration at the moment.
-
The road to OCaml 5.0
[3] Domainslib -- Parallel Programming over Multicore OCaml, https://github.com/ocaml-multicore/domainslib
What are some alternatives?
statsd-filter-proxy-rs - A filter proxy for StatsD
ocaml-multicore - Multicore OCaml
opam - opam is a source-based package manager. It supports multiple simultaneous compiler installations, flexible package constraints, and a Git-friendly development workflow.
ocaml - The core OCaml system: compilers, runtime system, base libraries
eioio - Effects-based direct-style IO for multicore OCaml
CorrinoEngine - CorrinoEngine is an open-source project which will recreate the Emperor : Battle for Dune
rescript-compiler - The compiler for ReScript.
melange - A mixture of tooling combined to produce JavaScript from OCaml & Reason
esy - package.json workflow for native development with Reason/OCaml
codeworld - Educational computer programming environment using Haskell
RFCs - Design discussions about the OCaml language