Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split package #255

Merged
merged 1 commit into from
Sep 2, 2024
Merged

Split package #255

merged 1 commit into from
Sep 2, 2024

Conversation

polytypic
Copy link
Collaborator

@polytypic polytypic commented Aug 31, 2024

This splits the picos package into several smaller packages, roughly:

  • picos -> (backoff, thread-local-storage)
    • The core interface
  • picos_aux -> (backoff, multicore-magic)
    • Mostly lock-free data structures (these might be sent to Saturn in the future)
  • picos_std -> picos(, backoff, multicore-magic)
    • Scheduler agnostic libraries
  • picos_stdio -> picos_std, picos_aux, and unix(, mtime, psq)
  • picos_stdio_cohttp -> picos_stdio(, cohttp, fmt, uri)
  • picos_mux -> picos_std, picos_aux, and optionally on picos_stdio
    • Schedulers
  • picos_lwt -> picos_std, picos_aux(, lwt)
  • picos_meta -> all of the above
    • Integration (and other) tests
    • Makes it easy to simplify the dependencies of other packages

The above changes should make it easier for people to depend only on the packages they need. A single package with dependencies to lwt and cohttp is just too heavy.

This also removes the Exn_bt module and type entirely. It is impossible to have such a module in OCaml.

Due to the split to multiple packages the structure of the documentation has also been updated. Currently odoc doesn't support references between packages, which, unfortunately, downgrades the quality of the documentation.

Finally, it has become clear that Miou is not compatible with Picos. There are several reasons for this:

  • Miou wants core Picos to be a single file that could be trivially copied and built without tooling such as dune and opam
  • Miou wants to remove Cancel_after, because it is, according to Miou's author, impossible to support in MirageOS
  • Miou wants to remove Fiber.t (replacing it with an integer id)
  • Miou finds the implementation of Fiber.FLS unacceptable, because it uses the Obj module to store heterogenous values in an array (similar to what Stdlib.Domain.DLS does)
  • Miou is opposed to use of thread-local-storage, which is currently used on OCaml 4 and will likely be used in the future to significantly speed up Fiber.current and Fiber.spawn (note that TLS also uses Obj like Stdlib.Domain.DLS)
  • Miou requires that the direct parent of a child must await for the child to terminate — Picos requires such (and other) constraints to be implemented outside of the scheduler
  • Miou finds the governance of Picos unacceptable
  • It was also unacceptable for Miou for Picos to include the Exn_bt module(, library, and package) — those have been removed

Thanks to c-cube for starting the work on this in #249!

@polytypic polytypic force-pushed the split-package branch 24 times, most recently from 35ddb52 to c2c86dc Compare September 1, 2024 10:44
@polytypic polytypic marked this pull request as ready for review September 1, 2024 18:07
@polytypic polytypic force-pushed the split-package branch 4 times, most recently from 7a073c9 to 58086c5 Compare September 2, 2024 02:18
@polytypic polytypic force-pushed the split-package branch 3 times, most recently from b79ac4f to 5f96f03 Compare September 2, 2024 03:17
This splits the picos package into several smaller packages, roughly:

- `picos` -> (`backoff`, `thread-local-storage`)
- `picos_aux` -> (`backoff`, `multicore-magic`)
- `picos_std` -> `picos`(, `backoff`, `multicore-magic`)
- `picos_stdio` -> `picos_std`, `picos_aux`, and `unix`(, `mtime`, `psq`)
- `picos_stdio_cohttp` -> `picos_stdio`(, `cohttp`, `fmt`, `uri`)
- `picos_mux` -> `picos_std`, `picos_aux`, and optionally on `picos_stdio`
- `picos_lwt` -> `picos_std`, `picos_aux`(, `lwt`)

- `picos_meta` -> all of the above for integration tests and to simplify
  dependencies of other packages

The above changes should make it easier for people to depend only on the
packages they need.  A single package with dependencies to `lwt` and `cohttp` is
just too heavy.

This also removes the `Exn_bt` module and type entirely.  It is impossible to
have such a module in OCaml.

Due to the split to multiple packages the structure of the documentation has
also been updated.  Currently odoc doesn't support references between packages,
which, unfortunately, downgrades the quality of the documentation.
@polytypic polytypic linked an issue Sep 2, 2024 that may be closed by this pull request
@polytypic polytypic merged commit 53fe09b into main Sep 2, 2024
6 checks passed
@polytypic polytypic deleted the split-package branch September 2, 2024 11:57
@polytypic polytypic mentioned this pull request Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider splitting Picos into (at least) two packages
2 participants