Skip to content

Usage of Core in the docs #3664

Description

@N1ark

Hi! I was reading the garbage collector docs on ocaml.org, and noticed that the Core library is used in an example (i have not checked if this is the case in other parts of the docs). I understand Core is widely used in the ecosystem but I personally don't use it in my projects (by choice), and find it rather unpleasant that examples explain how to do things using it, as it means I have to somehow "guess" what the right calls I should do myself.

For instance, in this example Gc.tune ~minor_heap_size:(262144 * 2) () is used, which doesn't exist; what's needed using only stdlib is:

Gc.set
  (let c = Gc.get () in
    { c with minor_heap_size = 262144 * 2 })

I agree the example with Core is easier to read but then that's a failure on the Stdlib for not being ergonomic to use; i think we should strive to making the stdlib nicer to use and use the docs as a playground to see where we fail at being ergonomic, rather than using Core as a cop-out.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions