Implementation history

duras has existed in three implementations: Python, C, and OCaml.

Python (2024–present)

The original implementation. Written in Python 3, distributed via PyPI, no external dependencies. Still maintained at codeberg.org/duras/duras-python.

Version 1.1.5 is the final feature release. Bug fixes only going forward.

C (2025)

A complete native reimplementation. Written to verify that the design could be realised as a dependency-free binary and to establish a performance baseline.

Frozen at v1.1.4-c. No further development planned. Source: c-frozen branch.

OCaml (2026–present)

The primary implementation. Native binary, no runtime dependencies. Chosen because the language's type system and pattern matching map cleanly to the command structure and error model, and because the compiler enforces exhaustiveness at build time.

The move was not a response to any failure of the Python implementation. It was a deliberate choice based on language fit.

Benchmark

Measured on Linux 6.12, OCaml 5.3.0, Python 3.13.5. Realistic corpus: 7300 notes, 20-year archive, mixed sizes. Stress corpus: 50000 notes, uniform.

Interactive commands (realistic corpus, 7300 notes):

Command

C

OCaml

Python

startup

0.6 ms

1.3 ms

25.2 ms

path

0.5 ms

1.3 ms

27.1 ms

show

0.5 ms

1.3 ms

26.5 ms

append

2.2 ms

2.9 ms

30.8 ms

Traversal commands (stress corpus, 50000 notes):

Command

C

OCaml

Python

list

39.6 ms

53.9 ms

87.1 ms

search

311.6 ms

532.1 ms

637.9 ms

audit

609.7 ms

409.9 ms

237.0 ms

Binary sizes (stripped): C 44 KB · OCaml 1.6 MB · Python 71 KB source.

OCaml is 11–21× faster than Python for interactive commands. For large corpus traversal it is faster than Python on list and search. Python retains an advantage on audit due to os.scandir efficiency. C is fastest throughout; the OCaml-to-C gap is 1.3–1.7× on traversal.

Specification

The specification is implementation-independent and lives in spec/. A shared compatibility test suite (121 tests) verifies conformance.

duras build

This function was added in v2.1.0. Converts the note collection to a static HTML website. Measured on Debian GNU/Linux, OCaml 5.3.0. Realistic corpus: 7,300 notes, 30 MB input, 34 MB output, 7,332 files. Stress corpus: 50,000 minimal notes.

Corpus

Notes

Wall

OCaml

Sys

RSS

Realistic

7,300

219 ms

134 ms

85 ms

43 MB

Stress

50,000

953 ms

410 ms

542 ms

—

duras converted a 20-year personal archive of 7,300 realistic sigline notes into a navigable static website in 219 milliseconds (33,000 pages / sec). The build produced 7,332 files: 7,300 pages, one collection index, one tag index, and 30 tag pages. The output directory structure mirrors the original note hierarchy (year/month/date), and every tag in the corpus receives its own page.