What's the difference between Jane Street's ‘Base’, ‘Core’ and 'Core_kernel'?
Asked Answered
P

1

12

I'm new to OCaml, and I it's often suggested that I use Jane Street's standard-library instead of the one that ships with the compiler.

However, there seem to even be several of those, and I don't know which I should be using:

Can anybody quickly summarize the difference between these (and perhaps vs. Batteries, etc), or when and why I should choose one over the others?

Percussionist answered 2/10, 2017 at 19:56 Comment(3)
For completeness, there's also core_kernel which is also by JS, it would be nice to cover it in the answers as well.Reservoir
I had exactly that thought, @ÉtienneMillon! 🤣Percussionist
I think the Jane Street folks are working on reorganizing some of the documentation and module structure, so hopefully this will all become a little bit clearer in the future. The Batteries not Included and Containers libraries are alternatives to the Jane Street libraries, for many purposes. I find Batteries' documentation easier to navigate than Core, at present, fwiw.Turner
M
15

I was hoping someone more knowledgable would come along to answer this, but here's the gist of it at least, straight from the horse's mouth:

  • Base: minimal stdlib replacement. Portable and lightweight and intended to be highly stable.
  • Core_kernel: Extension of Base. More full featured, with more code and dependencies, and APIs that evolve more quickly. Portable, and works on Javascript.
  • Core: Core_kernel extended with UNIX APIs.
Misprize answered 5/10, 2017 at 15:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.