Skip to content
On this page

OCaml libraries

Web

  • Helix - Build reactive web interfaces in OCaml.
  • Hyper - OCaml Web client, composable with Dream.
  • h2 - HTTP/2 implementation written in pure OCaml.
  • Opium - Sinatra like web toolkit for OCaml.
  • OCaml On Ice - Web framework for OCaml in the style of Ruby on Rails.
  • http/af - High performance, memory efficient, and scalable web server written in OCaml.
  • Eliom - Framework for building client/server Web and mobile applications in OCaml.
  • ocaml-wasmtime - OCaml WebAssembly runtime powered by wasmtime.
  • Dream - Tidy, feature-complete Web framework. (Docs) (HN) (Example App)
  • OCaml JavaScript bindings
  • Tiny_httpd - Minimal HTTP server using good old threads + blocking IO, with small request router.
  • ocaml-cohttp - OCaml library for HTTP clients and servers using Lwt or Async.
  • Async_http - Simple HTTP server for async applications.
  • Pollinate - Platform agnostic OCaml library for P2P communications using UDP and Bin_prot.
  • Bonsai - Library for building interactive browser-based UI. (Web) (Setting up Bonsai)
  • ocaml-dispatch - Path-based dispatching for client- and server-side applications.
  • eehs - Effects Epoll HTTP Server.
  • Spring - Delightful OCaml web programming library.
  • gluten - Reusable runtime library for network protocols.

Test

  • Alcotest - Lightweight and colorful test framework.
  • Mutaml - Mutation Tester for OCaml.
  • Crowbar - Property fuzzing for OCaml.
  • qtest - Inline (Unit) Tests for OCaml.
  • QCheck - Property-based testing for OCaml.
  • Popper - Property-based testing at ease.
  • expect-test - Framework for writing tests in OCaml, similar to Cram.

Science

  • Owl - OCaml library for scientific and engineering computing. (HN) (Web)

ML

  • zeta - Functional neural networks in ocaml. (HN)
  • prbnmcn-clustering - Clustering with k-means, k-medoids & agglomerative clustering.
  • OCaNNL - OCaml Neural Networks Library with shape inference, MetaOCaml code generation.

DB

  • Caqti - Cooperative-threaded access to relational data.
  • PostgreSQL-OCaml - PostgreSQL Bindings for OCaml.
  • postgres-protocol - IO independent postgres protocol implementation.
  • chamelon - Small, simple block-backed key-value store for MirageOS.
  • ocaml_sql_query - Functional-style SQLite queries for OCaml.
  • epiSQL - SQL schema parser and code generator.
  • PGX - Pure OCaml PostgreSQL client library.
  • Sequoia - Type-safe query builder for OCaml.
  • rel - Relational database programming for OCaml.
  • tjr_kv - Key-value store for OCaml.
  • Petrol - High-level OCaml API for interacting with SQL databases.

Bindings

CLI

Error

  • ppx_let_locs - Improving stack trace for let monadic.
  • pp_loc - Provides support to additionally quote and highlight the input fragment the input that corresponds to a location (or a set of locations).
  • ppx_assert - Assert-like extension nodes that raise useful errors on failure.

GraphQL

  • ResGraph - Build implementation-first GraphQL servers in ReScript.

Graphics

  • Vg - Declarative 2D vector graphics for OCaml.
  • unicorn - Purely functional GUI algebra.
  • ocaml-orx - OCaml bindings to the Orx game library.
  • chapgame - Physics engine based on a priori collision detection approach.
  • Phantom-algebra - Small tensor library a la GLSL.
  • OCaml Canvas - Portable Canvas framework for OCaml. (Web) (HN)

Linux

Crypto

  • Cryptokit - Library of cryptographic primitives (ciphers, hashes, etc) for OCaml.
  • JOSE - JavaScript Object Signing and Encryption.

Other

  • OCamlbuild - Generic build tool, that has built-in rules for building OCaml library and programs.
  • ocaml-vdom - Elm architecture and (V)DOM for OCaml.
  • Lwt - OCaml promises and concurrent I/O.
  • higher - Higher-kinded programming in OCaml.
  • GraphQL Servers in OCaml - Create GraphQL servers in OCaml.
  • piaf - Client library for HTTP/1.X / HTTP/2 written entirely in OCaml.
  • OCamlgraph - OCaml graph library.
  • luv - Minimalist binding to libuv from OCaml and Reason.
  • Nice Parser - Nice parsers in OCaml without the boilerplate.
  • QCSTM - simple state-machine framework for OCaml based on QCheck.
  • deriving - Library simplifying type-driven code generation on OCaml.
  • OCamline - Command line interface for user input.
  • OCaml Batteries Included - Community-maintained foundation library for your OCaml projects.
  • incremental - Library for incremental computations.
  • Landmarks - Simple Profiling Library for OCaml.
  • pfff - Set of tools and APIs to perform static analysis, code visualizations, code navigations, or style-preserving source-to-source transformations such as refactorings on source code.
  • ppx_stage - Staged metaprogramming in stock OCaml.
  • Streaming - Fast, safe and composable streaming abstractions. (Announcement)
  • cameleer - Deductive Verification Tool for OCaml Programs.
  • Ppxlib - Base library and tools for ppx rewriters.
  • jsoo-react - Bindings to React for js_of_ocaml, including JSX ppx. Allows to use React from OCaml.
  • OByteLib - OCaml bytecode library tools. Useful to read, write and evaluate OCaml bytecode files.
  • bimage - Composable image processing library for OCaml.
  • Lwd - Lets you build values that changes over time.
  • Digestif - Hash algorithms in C and OCaml.
  • directories - OCaml library that provides configuration, cache and data paths.
  • Repr - Run-time representations of OCaml types.
  • OCaml-MPST - Communication library powered by Multiparty Session Types (abbreviated as MPST) in OCaml.
  • eqaf - Constant time equal function.
  • Pp - Pretty printing library.
  • capnp-ocaml - OCaml code generator plugin for the Cap'n Proto serialization framework.
  • TyXML - Build valid HTML and SVG documents.
  • parany - Parallelize any kind of computation.
  • Metrics - Infrastructure to collect metrics from OCaml applications.
  • ocaml-mustache - Mustache.js logic-less templates in OCaml.
  • ppx_optcomp - Optional compilation for OCaml.
  • Session-ocaml - Implementation of binary session types in OCaml.
  • brr - Browser programming toolkit for OCaml.
  • Dyntype - Dynamic types for OCaml.
  • RML - ML modules and functors as first-class citizens.
  • VOCaL - Verified OCaml Library.
  • Fmt - OCaml Format pretty-printer combinators.
  • awa-ssh - Purely functional SSH library in OCaml.
  • Fmlib - Functional Monadic Library for Ocaml.
  • eioio - Effects-based direct-style IO for multicore OCaml. (0.1 release) (Lobsters)
  • RES - OCaml library for resizable arrays and strings.
  • Preface - Opinionated library designed to facilitate the handling of recurring functional programming idioms in OCaml.
  • OCaml Containers - Modular, clean and powerful extension of the OCaml standard library.
  • vec - Fast, safe mutable dynamic arrays for OCaml.
  • um-abt - OCaml library implementing abstract binding trees (ABTs).
  • ocaml-stun - Pure OCaml implementation of the Session Traversal Utilities for NAT (STUN) protocol (STUN).
  • ortac - OCaml Runtime Assertion Checking.
  • Bloomf - Efficient Bloom filters for OCaml.
  • Index - Scalable implementation of persistent indices in OCaml.
  • ppx_effects - Syntax extensions for untyped effects in OCaml 5.
  • kv-hash - Key Value store using a persistent hashtable approach.
  • DAI - Demanded Abstract Interpretation.
  • field_repr - Efficient run-time representations of OCaml record fields.
  • CacheCache - Efficient caching library for OCaml.
  • ocaml-extlib - Extended Standard Library for OCaml.
  • MParser - Simple monadic parser combinator library for OCaml.
  • futurama - Finite permutation library with an optimizing compiler.
  • algebra - Definitions for common algebraic structures.
  • ocaml-lp - Helps the modeling of Linear Programming (LP) and Mixed Integer Programming (MIP) in OCaml.
  • ppx_regexp - Matching Regular Expressions with OCaml Patterns.
  • Shuttle - Buffered channels for async.
  • Poll - Portable OCaml API to poll file descriptors for IO readiness. Supports kqueue and epoll for now.
  • ART - Adaptive Radix Tree in OCaml.
  • Avro - Runtime library and schema compiler for the Avro serialization format.
  • CMON - Library for printing OCaml values with sharing.
  • Equinoxe - Equinix API client library for OCaml.
  • ocaml_plugin - Automatically build and dynlink OCaml source files.
  • Lwt Pipe - Multi-consumer, multi-producers blocking queue and stream for Lwt.
  • sedlex - Unicode-friendly lexer generator for OCaml.
  • Compact - Memory-efficient data structures in OCaml.
  • PaComb - Parsing library that compiles grammars to combinators using elimination of left recursion.
  • PPrint - Pretty-Printing Toolbox.
  • Multicont - Continuations with multi-shot semantics in OCaml.
  • ExtUnix - OCaml bindings to various low-level system APIs not covered by Unix module.
  • ocaml-arrow - OCaml bindings for Apache Arrow using the C++ api.
  • ocaml-in-python - Effortless Python bindings for OCaml modules.
  • Yojson - Low-level JSON parsing and pretty-printing library for OCaml.
  • ATD - Static types for JSON APIs.
  • Biocaml - OCaml Bioinformatics Library.
  • Iter - Simple iterator abstract datatype, intended to iterate efficiently on collections while performing some transformations.
  • sosa - Sane OCaml String API.
  • ocaml-stdint - Various signed and unsigned integers for OCaml.
  • Current_incr - Self-adjusting computations.
  • hlist - Heterogeneously-typed lists for OCaml.
  • ppx_import - Syntax extension that allows to pull in types or signatures from other compiled interface files.
  • Prime - OCaml Library Supplements.
  • ADT rewriting - Representing ADTs in a flat way and compiling a pattern match-like construction as a rewrite on the memory representation.
  • AlphaRegex - Synthesizer for regular expressions.
  • py.ml - OCaml bindings for Python.
  • Affect - Composable concurrency primitives with OCaml effects handlers.
  • Depyt - Type combinator library.
  • ocaml-websocket - Websocket library for OCaml.
  • ORaft - Library of Raft consensus algorithm implemented in OCaml.
  • ocaml-mpsc - Lockless Multiple Producer Single Consumer Queue for ocaml-multicore.
  • Charset - Fast char sets.
  • OCaml gRPC
  • lockfree - Lock-free data structures for multicore OCaml.
  • Backward Lists - Defines backward lists that are isomorphic to lists.
  • bistro - Library to build and execute typed scientific workflows.
  • domainslib - Parallel Programming over Multicore OCaml.
  • Conformist - Schema definition and validation with support for decoding to bridge the gap between runtime types and static types.
  • ocaml-crunch - Convert a filesystem into a static OCaml module.
  • Ocaml protoc plugin
  • ocaml-rust - Safe OCaml-Rust Foreign Function Interface.
  • shared-block-ring - Simple on-disk fixed length queue.
  • ocaml-protoc - Protobuf Compiler for OCaml.
  • Diskuv Box - Basic, cross-platform set of commands to manipulate and query the file system.
  • raylib-ocaml - OCaml bindings for raylib, a simple and easy-to-use library to enjoy video games programming.
  • ocplib-json-typed - Libraries for reliable manipulation JSON objects.
  • ocaml-alg - Algebraic structures in OCaml.
  • Kai - Library for handling compiler diagnostics and span-associated metadata.
  • midi - Experimenting with midi in OCaml.
  • gen_js_api - Easy OCaml bindings for JavaScript libraries.
  • metapp - Meta-preprocessor for OCaml.
  • Ego - EGraphs in OCaml.
  • Bindoj - Generative datatype toolkit for OCaml centric workflows.
  • Algebraic Effect - Effects system for continuation.
  • metadata - Library to read metadata from files in various formats.
  • Tensority - Strongly typed multidimensional array library for OCaml.
  • ocaml-optics - Monomorphic optics using existentials.
  • ppx_viewpattern - Transformation for view patterns in OCaml.
  • mcavl - Lock-free Sets and Maps for OCaml multicore.
  • imagelib - Imagelib library implements image formats such as PNG or PPM.
  • Bindlib - Efficient binder representation in OCaml.
  • ocaml-earley - Parsing library based on Earley Algorithm.
  • Accessor - Library that makes it nicer to work with nested functional data structures.
  • Cinaps - Trivial Metaprogramming tool using the OCaml toplevel.
  • loko-ml - Lower-Kinded Optics for OCaml.
  • Tyre - Typed Regular Expressions.
  • agrep - String searching with errors, using the Wu-Manber algorithm.
  • OCaml macros
  • Shexp - Process library and s-expression based shell.
  • Timere - OCaml date time handling and reasoning suite.
  • stramon - Strace based program behavior monitor/analyzer.
  • pixeldrift - Find perceptible pixel differences with OCaml.
  • Parmap - Minimalistic library allowing to exploit multicore architecture for OCaml programs with minimal modifications.
  • serde.ml - Serialization framework for OCaml.
  • Confero - Unicode collation library for OCaml.
  • ppx_let - Monadic let-bindings.
  • ezgzip - Simple gzip (de)compression library.
  • Stores - OCaml library that offers several implementations of (in-memory) stores.
  • Logger - Library logger.
  • Combo - Simple parser combinator library for Ocaml.
  • ocaml-search - Simple, in-memory, monomorphic and heterogeneous search indexes in OCaml.
  • Decompress - Pure OCaml implementation of Zlib.
  • Idle-Domains - Co-operative allocation of domains for OCaml.
  • talaria_bibtex - Bibtex file parser.
  • Mmap - Functions for mapping files in memory.
  • PCRE-OCaml - Perl Compatibility Regular Expressions for OCaml.
  • kcas - Multi-word compare-and-swap library.
  • ctypes - Library for binding to C libraries using pure OCaml.
  • refl - Efficient and type-safe type reflection for OCaml.
  • radixmap - Map a la Binary Radix Tree.
  • ocaml-iomux - IO multiplexers bindings for ocaml (poll/kqueue/epoll and so on).
  • OTOML - TOML parsing, manipulation, and pretty-printing library for OCaml.
  • Bitstring - Bitstring matching for OCaml.
  • Gen - Simple, efficient iterators for OCaml.
  • Format-doc - Alternative interpreter for OCaml format strings.
  • Distrproc - Erlang style process/actor model library in OCaml.
  • pyre-ast - OCaml library to parse Python files.
  • deque - Purely Functional, Real-Time Deques with Catenation (Kaplan & Tarjan).
  • Lwt_eio - Use Lwt libraries from within Eio.
  • Kqueue - OCaml bindings to kqueue.
  • Typegist - Reflect the essence of OCaml types as values.
  • CFG - OCaml library for manipulating context-free grammars.
  • prettree - Pretty tree layout with an applicative functor.
  • ocaml-qdrant - OCaml client for Qdrant vector search engine.
  • signal - Reactive signals for OCaml.
  • Trace - Common interface for tracing/instrumentation libraries in OCaml.
  • Par_incr - Parallel version of incremental library.
  • uopt - Option-like type that incurs no allocation, without requiring a reserved value in the underlying type.
  • ocaml-integers - Various signed and unsigned integer types for OCaml.
  • lens - Port of (a subset of) the lens library for Haskell to OCaml, using modular implicits.
  • ocaml-rtree - Pure OCaml implement of R-Trees.
  • Iostream - Generic I/O streams of bytes.
  • OCaml Cairo - Binding to Cairo, a 2D Vector Graphics Library.