Skip to content

[OxCaml] Tutorial for library parameter#12111

Merged
shonfeder merged 10 commits intoocaml:mainfrom
maiste:doc/parameter-explanation
Jan 26, 2026
Merged

[OxCaml] Tutorial for library parameter#12111
shonfeder merged 10 commits intoocaml:mainfrom
maiste:doc/parameter-explanation

Conversation

@maiste
Copy link
Copy Markdown
Collaborator

@maiste maiste commented Aug 1, 2025

This PR is ready for review.

The tutorial aims to follow a simple flow to go through all the possibilities provided by parameterized libraries. It covers the entire "diamond" of the parameterized library, i.e.:

    parameter
   /         \
implement   parameterized
   \         /
    instance

The tutorial covers:

  • Setting up a project
  • Writing a parameter
  • Writing the implementation of the parameter
  • Writing a parameterized library
  • Instantiate a parameterized library

@maiste maiste added docs Documentation improvements oxcaml Related to the support to OxCaml functionnalities labels Aug 1, 2025
@maiste maiste added docs Documentation improvements oxcaml Related to the support to OxCaml functionnalities labels Aug 1, 2025
@maiste maiste force-pushed the doc/parameter-explanation branch from 5732b55 to 0106436 Compare August 1, 2025 14:53
@shonfeder shonfeder self-assigned this Aug 5, 2025
Copy link
Copy Markdown
Collaborator

@Sudha247 Sudha247 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm reading through this with the intention of taking it over from @maiste (thanks for all the hard work!). Leaving some notes below.

Parameterized library in Dune are a concept similar to
{doc}`/virtual-libraries`. Parameterized libraries are the formalization within
the compiler of virtual libraries.A parameterized library is conceptually
equivalent to a functor. For more detailled explanation, see (TODO @maiste:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it meant to link some documentation about parameterized libraries? Is it available somewhere?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes 👍🏻

@Sudha247
Copy link
Copy Markdown
Collaborator

@maiste is it ok if I push to this branch directly?

@maiste
Copy link
Copy Markdown
Collaborator Author

maiste commented Aug 28, 2025

Yes it that exactly the purpose of this PR 😄

maiste and others added 6 commits December 5, 2025 12:20
Signed-off-by: Etienne Marais <dev@maiste.fr>
Signed-off-by: Etienne Marais <self@maiste.fr>
Signed-off-by: Etienne Marais <self@maiste.fr>
Signed-off-by: Etienne Marais <self@maiste.fr>
Signed-off-by: Etienne Marais <self@maiste.fr>
Signed-off-by: Sudha Parimala <sudharg247@gmail.com>
@art-w art-w force-pushed the doc/parameter-explanation branch from 24fb410 to 4a1cbd2 Compare December 5, 2025 16:37
Signed-off-by: Arthur Wendling <arthur@tarides.com>
@art-w art-w force-pushed the doc/parameter-explanation branch from 4a1cbd2 to 0462a91 Compare December 5, 2025 16:38
Sudha247 added a commit that referenced this pull request Dec 11, 2025
Closes #11652

Adds a tutorial for setting up an OxCaml project with Dune package
management.

I contemplated where this should go, and thought this might be a good
place, after all. It shows (1) how to setup an OxCaml project, (2)
servers as a live example of the previous two tutorials.

#12111 is a more comprehensive tutorial about parametric libraries and
OxCaml, but it doesn't specifically cover the topic of Dune package
management with OxCaml. I recently ported an OxCaml project to build
with Dune package management and the configuration was not as
straightforward as I expected, and thought a tutorial on this topic
might be useful.

This takes some material from https://github.com/gridbugs/hello-oxcaml
(thanks @gridbugs!).

---------

Signed-off-by: Sudha Parimala <sudharg247@gmail.com>
jonludlam pushed a commit to jonludlam/dune that referenced this pull request Jan 14, 2026
…#12780)

Closes ocaml#11652

Adds a tutorial for setting up an OxCaml project with Dune package
management.

I contemplated where this should go, and thought this might be a good
place, after all. It shows (1) how to setup an OxCaml project, (2)
servers as a live example of the previous two tutorials.

ocaml#12111 is a more comprehensive tutorial about parametric libraries and
OxCaml, but it doesn't specifically cover the topic of Dune package
management with OxCaml. I recently ported an OxCaml project to build
with Dune package management and the configuration was not as
straightforward as I expected, and thought a tutorial on this topic
might be useful.

This takes some material from https://github.com/gridbugs/hello-oxcaml
(thanks @gridbugs!).

---------

Signed-off-by: Sudha Parimala <sudharg247@gmail.com>
@shonfeder shonfeder self-assigned this Jan 22, 2026
- clean up some syntax errors (dangling `::::`)
- try to make expressions more precise and concise
- add analogy example tables to each section, aiming ot help build on
  people's intuitions of ocaml

Signed-off-by: Shon Feder <shon.feder@gmail.com>
@shonfeder shonfeder force-pushed the doc/parameter-explanation branch from 5262169 to 45905d7 Compare January 24, 2026 01:51
@shonfeder shonfeder requested a review from Sudha247 January 24, 2026 01:52
@shonfeder shonfeder changed the title [draft][OxCaml] Tutorial for library parameter [OxCaml] Tutorial for library parameter Jan 24, 2026
@shonfeder shonfeder marked this pull request as ready for review January 24, 2026 01:52
Signed-off-by: Shon Feder <shon.feder@gmail.com>
@shonfeder
Copy link
Copy Markdown
Member

I have reviewed and worked thru the tutorial and offered my suggestions in the commit 45905d7

All the instructions where easy to follow and correct. This is good to be merged, IMO, but one commit is missing the needed DCO signoffs: 822d1cb

FYI @art-w and @Sudha247

@shonfeder shonfeder merged commit 59c358e into ocaml:main Jan 26, 2026
50 of 52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation improvements oxcaml Related to the support to OxCaml functionnalities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants