ocaml-sexplib

Crates.ioocaml-sexplib
lib.rsocaml-sexplib
version0.0.1
created_at2025-08-18 04:33:27.833233+00
updated_at2025-08-18 04:33:27.833233+00
descriptionAn implementation of OCaml's sexplib library
homepage
repositoryhttps://github.com/PaulJuliusMartinez/ocaml-sexplib-for-rust
max_upload_size
id1799943
size174,420
Paul Julius Martinez (PaulJuliusMartinez)

documentation

README

An implementation of Jane Street's sexplib S-expression data format, with serde support for serialization and deserialization.

Unlike OCaml (de)serialization with ppx_sexp_conv, which requires materialization an entire Sexp.t in memory, the serde implementations in this crate serialize directly to/from the string representation.

Todo

  • Performance
    • Add benchmarking
    • SIMD tokenization implementation
    • Use memchr where appropriate
    • More efficient number/float (de)serialization
    • Never return InputRef::Transient from RawTokenizer when using a SliceInput
  • Correctness
    • Serialization of numbers that contain underscores
    • Add fuzz tests
  • API
    • Source input positions during parse errors
    • Add from_reader/many_from_reader/iter_from_reader functions
    • Add from_{slice,str}_owned functions that read from in memory data, but don't keep a reference to it.
    • sexp::Sexp should store bytes instead of a str, and/or there should be separate sexp::str and sexp::bytes modules
    • Support partial unescaping from invalid data, e.g. echo '"ab\xg"' | sexp print prints "ab\\xg"
  • Code/docs
    • Clean up... lots of code and public interfaces?
    • Add doc comments everywhere
    • Add documentation to readme about mapping between Rust/serde and OCaml/ppx_sexp_conv data models and serialization rules
Commit count: 0

cargo fmt