https://github.com/logseq/persistent-sorted-set-ocaml
Persistent sorted set for OCaml
https://github.com/logseq/persistent-sorted-set-ocaml
Last synced: about 1 month ago
JSON representation
Persistent sorted set for OCaml
- Host: GitHub
- URL: https://github.com/logseq/persistent-sorted-set-ocaml
- Owner: logseq
- License: mit
- Created: 2026-06-18T05:26:15.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-06-20T02:15:12.000Z (about 1 month ago)
- Last Synced: 2026-06-20T02:19:29.439Z (about 1 month ago)
- Language: OCaml
- Size: 107 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Persistent Sorted Set OCaml
An OCaml port of Logseq's persistent sorted set implementation.
The library provides a persistent ordered set data structure intended for DataScript-style indexes, where ordered iteration, range access, and immutable updates are core operations.
## Goals
- Preserve the behavior expected by the ClojureScript persistent sorted set implementation.
- Provide a small OCaml API that can be used from native OCaml and js_of_ocaml.
- Keep the implementation readable and predictable for DataScript index workloads.
## Development
Requirements:
- OCaml 5.2.1 or newer
- Dune 3.17 or newer
- Node.js for js_of_ocaml smoke tests
Common commands:
```sh
dune build
dune runtest
```
Benchmark and upstream comparison helpers live in `script/`:
```sh
bash script/benchmark_vs_cljs.sh
bash script/diff_upstream_tests.sh
```
## Repository Layout
- `lib/`: library implementation and interface
- `test/`: native and js_of_ocaml tests
- `bench/`: benchmark entry points
- `script/`: benchmark and upstream comparison helpers
- `docs/`: performance notes
## Credits
This project is an OCaml port of Logseq's ClojureScript persistent sorted set work.
Primary credit goes to the upstream ClojureScript repository:
- https://github.com/logseq/persistent-sorted-set
The OCaml implementation is written independently, with upstream behavior used as the compatibility reference.