Ranked awesome lists, all in one place
This list is a copy of rizo/awesome-ocaml with ranks
Awesome OCaml ★87749 =============
Everything you’ll ever need on the road to mastering OCaml.
If you’re looking for comprehensive community-driven content about OCaml visit 📚OCamlverse!
For a quick intorduction to the modern OCaml development workflow consult the OCaml for the impatient guide.
Your favorite package is not listed? Fork and create a Pull Request to add it!
- Algorithms and Data Structures
- Application Libraries
- Code Analysis and Linters
- Compilers and Compiler Tools
- Developer Tools
- Formal Software Verification
- User Interface
- Mobile Applications
- Online Courses
- Package Management
- Regular Expressions
- Science and Technical Computing
- Security and Cryptography
- Semantic Technology
- System Programming
- Web Development
- Official OCaml Website
- OCaml Discourse Web Forum
- OCaml Discord Chat
- Official OCaml Mailing List
- OCaml Planet
- OCaml SubReddit
Algorithms and Data Structures
- Comparing a Machine Learning Algorithm Implemented in F# and OCaml
- OCamlgraph ★110 – A generic graph library for OCaml.
- ods ★19 – A large collection of data structures and algorithms for OCaml.
- combine ★17 ⏳2Y – OCaml library for combinatorics https://www.lri.fr/~filliatr/combine/.
- Decompress - A pure OCaml implementation of Zlib
- Batteries Included ★331 – A community-maintained foundation library for your OCaml projects.
- Cmdliner ★86 – Declarative definition of command line interfaces for OCaml.
- Core – Jane Street Capital’s full-fledged standard library overlay. A portable subset of Core is also available: Core_kernel ★132.
- Base ★193 - Jane Street Capital’s dependency-free, quick-compiling, fully-portable across any environment that can run OCaml code standard library.
- React – React is an OCaml module for functional reactive programming (FRP). It provides support to program with time varying values: declarative events and signals.
- Minicli ★8 – Minimalist library for command line parsing.
- ctypes ★189 – Library for binding to C libraries using pure OCaml.
- easy-format ★19 – Pretty-printing library for OCaml.
- ocaml-rpc ★43 – Light library to deal with RPCs in OCaml.
- ocaml-containers ★189 – A lightweight, modular standard library extension, string library and interfaces to various libraries (bigarrays, unix, etc…). BSD license.
- More OCaml: Algorithms, Methods, and Diversions – In More OCaml John Whitington takes a meandering tour of functional programming with OCaml, introducing various language features and describing some classic algorithms. The book ends with a large worked example dealing with the production of PDF files. There are questions for each chapter together with worked answers and hints.
- How to Think Like a (Functional) Programmer by Allen Downey and Nicholas Monje – How to Think Like a Computer Scientist is an introductory programming textbook based on the OCaml language. It is a modified version of Think Python by Allen Downey. It is intended for newcomers to programming and also those who know some programming but want to learn programming in the function-oriented paradigm, or those who simply want to learn OCaml.
- OCaml from the Very Beginning by J. Whitington - OCaml from the Very Beginning will appeal both to new programmers, and experienced programmers eager to explore functional languages such as OCaml.
- Pearls of Functional Algorithm Design by Richard Bird - It summaries 30 hard algorithm problems in function programming world. Although it is for Haskell, the algorithm problems are very interesting and trying to solve them in OCaml also helps the thinking of functional programming. Partial solutions in OCaml are here ★15 ⏳3Y.
- Real World OCaml by Y. Minsky, A. Madhavapeddy and J. Hickey - Functional programming for the masses.
- Unix System Programming in OCaml by X. Leroy and D. Rémy – Introduction to Unix system programming, with an emphasis on communications between processes.
- Using, Understanding, and Unraveling OCaml – This book describes both the OCaml language and the theoretical grounds behind its powerful type system.
- Purely Functional Data Structures - This is the first or only book focus on various data structures in FP world. A must-read one.
- OCaml for Scientists - by Jon Harrod.
Code Analysis and Linters
- Mascot - Mascot is a style-checker for OCaml sources
- pfff ★2226 ⏳1Y – pfff is a set of tools and APIs to perform some static analysis, dynamic analysis, code visualizations, code navigations, or style-preserving source-to-source transformations such as refactorings on source code.
- infer ★8598 - infer is a static analyzer for Java, C and Objective-C
- Ocamllint ★61 - Ocamllint detects common errors in OCaml code
- BetterErrors - BetterErrors improves error messages of the OCaml compiler (Make OCaml Errors Great Again.)
- SLAyer ★300 ⏳2Y - SLAyer is an automatic formal verification tool that uses separation logic to verify memory safety of C programs.
- MemCAD ★9 - MemCAD is an abstract interpreter for shape analysis. MemCAD can verify C programs manipulating complex data structures.
- BAP ★649 - BAP is a reverse engineering and program analysis platform that targets binary programs.
Compilers and Compiler Tools
Languages and Compilers:
- cDuce - cDuce is a modern XML-oriented functional language with innovative features.
- Compcert C Compiler - It is a C Compiler supporting most of the ISO C90 and C99 / ANSI C features.
- Eff Programming Language - Eff is a functional language with handlers of not only exceptions, but also of other computational effects such as state or I/O.
- Hack Programming Language
- Haxe Programming Language
- Neko Programming Language - Originally the compiler was written in OCaml.
- Mezzo Programming Language - Mezzo is a programming language in the ML tradition, which places strong emphasis on the control of aliasing and access to mutable memory.
- OCaml-Java - OCaml to Java bytecode compiler.
- Opa Programming Language
- Rhine ★585 ⏳3Y – A Lisp on LLVM written in OCaml.
- Rust Programming Language - Originally written in OCaml before bootstrapping.
- Quick C– Target Language - It is now a dead project. Github Repo ★70 ⏳4Y. Alternative website.
- tis-interpreter ★473 ⏳1Y - An interpreter for finding subtle bugs in programs written in standard C
- Reason - Friendly syntax & toolchain for OCaml by Facebook.
- Others - Some other compilers implemented in OCaml, quite a few dead now.
Parser and Lexer Generators:
- Opal ★74 ⏳1Y – Self-contained monadic parser combinators for OCaml.
- Sedlex ★86 is a modern, encoding-agnostic (read: Unicode-supporting) lexer generator (the ppx-based successor to ulex.)
- Menhir – Menhir is a LR(1) parser generator for OCaml.
- ocamllex/ocamlyacc – lex and yacc implementation for OCaml.
- Angstrom ★203 - Parser combinators built for speed and memory efficiency
Two concurrency libraries exist in OCaml: Lwt and Async. They provide very similar functionality but make radically different decisions with regards to error handling and internal implementation details (see the links below for more details). Real World OCaml uses Async but a version of the code examples translated to Lwt ★54 ⏳1Y is also available.
- Dbm — A binding to the NDBM/GDBM Unix “databases”.
- Mongo.ml – An OCaml driver for Mongodb
PG’OCaml — A type-safe interface to PostgreSQL in pure OCaml.
- ppx_pgsql ★24 – A syntax extension for embedded SQL queries using PG’OCaml.
PostgreSQL-OCaml — An interface to PostgreSQL through the C API (
- SQLite3 ★43 — OCaml bindings to the SQLite3 database.
- Sqlite3EZ — Thin wrapper for SQLite3 with a simplified interface.
- ocaml-redis ★32 – Redis bindings for OCaml.
- mysql – Bindings to libmysqlclient for interacting with MySQL databases.
- mysql_protocol ★7 – Implementation of MySQL Protocol with the Bitstring library.
- New Implementations
- Try OCaml – Try OCaml in your web browser.
- codingground – Compile and execute OCaml code online.
- iocaml ★158 – An OCaml kernel for the IPython notebook.
- utop ★411 – Universal toplevel for OCaml with support of multiline edition, history, real-time and context sensitive completion, colors, and more.
- ocamlbrowser – A source and compiled interface browser, written using LablTk. Included in the standard distribution for ocaml <= 4.01 and with labltk for ocaml >= 4.02.
- ghim ★16 ⏳4Y – A command-line tool to manage Github Issues.
- OCaml Yeoman Generator – Yeoman generator to scaffold OCaml modules.
- Foreign Function Interface:
- merlin ★863 – Context sensitive completion for Ocaml in Vim and Emacs.
- tuareg ★188 - OCaml mode for Emacs that can run the toplevel and the debugger within Emacs.
- vscode-ocaml – extension that provides OCaml language support for VSCode ★52333
- Sublime better ocaml ★15 – Better OCaml mode for Sublime Text.
ocp-index – Easy access to the interface information of installed OCaml libraries. Provides standalone tools like
- ocp-indent – Indentation tool for OCaml, to be used from editors like Emacs and Vim.
- Code coverage:
- 99 problems. 99% solutions are here ★16 ⏳3Y.
- Rosetta Code
- OCaml at Exercism – Exercism is your place to engage in thoughtful conversations about code. Explore simplicity, idiomatic language features, and expressive readable code. Solutions.
Formal Software Verification
- Coq – Coq is a formal proof management system. It provides a formal language to write mathematical definitions, executable algorithms and theorems together with an environment for semi-interactive development of machine-checked proofs.
- Why3 – Why3 is a platform for deductive program verification. It provides a rich language for specification and programming, called WhyML, and relies on external theorem provers, both automated and interactive, to discharge verification conditions.
- Alt-Ergo – Alt-Ergo is an open-source SMT solver dedicated to the proof of mathematical formulas generated in the context of program verification.
- Functional Programming with OCaml
- Python to OCaml: retrospective
- OCaml for the Masses
- Why We Use OCaml
- Why OCaml?
- Xen – OCaml Coding Considerations
- Monads are a class of hard drugs
- Beginner’s guide to OCaml
- Why OCaml, why now?
- A blog about game development in OCaml
- (Functional) Alternatives to inheritance
- camlPDF ★78 – OCaml library for reading, writing and modifying PDF files.
- capnp-ocaml 2.0: The Road to Unembarrassing Performance
- slacko ★50 – A neat interface for Slack in OCaml.
- Learn X in Y minutes - Where X=OCaml.
- lablgtk — GTK2 bindings for OCaml with various higher-level facilities to define GUIs.
- lablqml ★88 – QML Qt5 bindings for OCaml.
- labltk — Interface to the Tcl/Tk GUI framework. In the standard distribution for ocaml <= 4.01.
- TSDL – Tsdl is an OCaml module providing thin bindings to the cross-platform SDL library.
- Lambda-Term ★89 – Lambda-Term is a cross-platform library for manipulating the terminal. It provides an abstraction for keys, mouse events, colors, as well as a set of widgets to write curses-like applications.
- Notty ★148 - Notty is a declarative terminal library for OCaml, structured around a notion of composable images.
- Higher-Rank Polymorphism in OCaml
- mikmatch ★20 ⏳1Y – OCaml pattern-matching extended with regexps
- Inlined records in constructors
- Algebraic Data Types
- XEN – OCaml Best Practices for Developers
- OCaml Style Guide - See also: , , .
- A safe but strange way of modifying OCaml compiler
- Fiddling with the OCaml Type System
- dolog ★23 ⏳1Y – A dumb OCaml logger.
- Volt ★3 – A variant of Bolt OCaml logging tool.
- Logs - Logs provides a logging infrastructure for OCaml.
- onanomsg ★31 – nanomsg bindings for OCaml.
- Kafka ★26 – OCaml bindings for Apache Kafka.
- AMQP ★38 – AMQP client library for Async and Lwt.
- MPI ★10 – Message Passing Interface bindings for OCaml.
- MQTT ★12 – OCaml implementation of the MQTT pubsub protocol.
- ppx_import – Import is a syntax extension that allows to pull in types or signatures from other compiled interface files.
ppx_string_interpolate ★7 ⏳3Y – A simple ppx filter to support string interpolation like
[%str "value of foo is $(foo)"].
- ppx_monad ★3 ⏳1Y – Monad syntax extension for OCaml.
- ppx_deriving_yojson – A Yojson codec generator for OCaml.
Tools and Language Extensions:
- MetaOCaml – an OCaml dialect for multi-stage programming.
- Fan – Fan is a compile-time metaprogramming system for OCaml, originally inspired from Camlp4. It’s a combination of OCaml and Lispy Macros. It shares the same concrete syntax with OCaml.
- camlp5 - Camlp5 is a preprocessor-pretty-printer of OCaml.
- camlp4 - Camlp4 is part of the standard OCaml distribution and is different from Camlp5.
- Cordova plugins ★19 ⏳1Y – List of bindings to Cordova plugins. Get access to native device components like accelerometer, SMS, geolocation, etc in OCaml.
- HTTP Tools:
- ocaml-dns ★47 – A pure OCaml implementation of the DNS protocol.
- fluent-logger ★5 ⏳3Y – Fluentd logger for OCaml.
- charrua-unix - charrua-unix is a Unix DHCP daemon based on charrua-core.
- Introduction to Functional Programming in OCaml.
- Cornell University – Data Structures and Functional Programming.
- Princeton University - Functional programming in OCaml.
- University of Illinois - Course that uses OCaml to teach functional programming and programming language design
Oasis - A tool to integrate a configure, build and install system in your OCaml project. It helps to create standard entry points in your build system and allows external tools to analyse your project easily.
- oasis2opam ★27 — Tool to convert OASIS metadata to OPAM package descriptions.
- obuild ★40 – Simple package build system for ocaml.
- dune ★349 – A composable and opinionated build system for OCaml (former jbuilder)
- jenga ★84 – Monadic build system from Jane Street.
- ocamlbuild — Build system provided with the compiler.
- ocaml-makefile ★51 — Easy to use Makefile for small to medium-sized OCaml-projects.
- topkg ★60 — OPAM-aware packaging system using ocamlbuild.
- Namespaces ★63 - ocamlbuild plugin that converts your directory tree into nested modules.
- Bazel ★23 - OCaml rules for Bazel, Google’s multi-language and platform build tool.
- Oasis - A tool to integrate a configure, build and install system in your OCaml project. It helps to create standard entry points in your build system and allows external tools to analyse your project easily.
(Note: Sorted from the easier to use to the more flexible.)
- Parmap — Provides easy-to-use parallel map and fold functions.
- ForkWork ★20 ⏳5Y — A simple library for forking child processes to perform work on multiple cores.
- Functory — A distributed computing library which facilitates distributed execution of parallelizable computations in a seamless fashion.
- Rpc.Parallel ★27 — A library for spawning processes on a cluster of machines, and passing typed messages between them.
Ocamlnet — An enhanced system platform library. Contains the
netmulticorelibrary to compute tasks on as many cores of the machine as needed.
- Nproc ★25 ⏳4Y – Process pool implementation for OCaml.
- Parany ★16 – Parallelize computation over independent items, even if there is an infinite number of them.
- Sklml – Functional parallel skeleton compiler and programming system for OCaml programs.
Science and Technical Computing
- biocaml ★81 – OCaml Bioinformatics Library http://biocaml.org.
- guizmin ★4 ⏳1Y – OCaml library for building bioinformatics pipelines.
- lacaml - OCaml bindings for BLAS/LAPACK (high-performance linear algebra Fortran libraries).
- obandit - OCaml library for multi-armed bandits.
- onumerical ★7 ⏳4Y – Numerical library for OCaml.
- oml - OCaml library for general numerical work.
ocephes ★9 ⏳2Y - Bindings to frequently used
Cspecial funcitons library.
- slap ★52 - A linear algebra library in OCaml with type-based static size checking for matrix operations.
- tensorflow-ocaml ★157 – OCaml bindings for TensorFlow.
- owl - OCaml numerical library: dense and sparse matrix, linear algebra, regressions, maths and stats functions.
- Re ★106 – a pure OCaml regular expressions library with combinators, supporting several formats (glob, posix, str…)
- ocaml-pcre ★15 – bindings to the PCRE library (perl-compatible regular expressions)
- Humane-re ★18 ⏳2Y – Humane-re attempts to provide an easy interface for 90% of your regex needs Courtesy of ocaml-re
- Tyre ★104 ⏳1Y - Tyre is a set of combinators to build type-safe regular expressions, allowing automatic extraction and modification of matched groups.
Security and Cryptography
- ocaml-tls ★199 – TLS in pure OCaml.
- Digestif ★26 - Hash algorithms (like SHA* or BLAKE2*) in OCaml and C.
- cryptokit ★31 – The Cryptokit library for OCaml provides a variety of cryptographic primitives that can be used to implement cryptographic protocols in security-sensitive applications.
- nocrypto ★66 – A small cryptographic library behind the ocaml-tls project. It is built to be straightforward to use, adhere to functional programming principles and able to run in a Xen-based unikernel.
Note: The differences between
cryptokitcryptographic libraries are described in the following blog post: OCaml-TLS: building the nocrypto library core.
- OCaml-RDF – OCaml library to manipulate RDF graphs and execute Sparql queries.
- bencode ★12 — Bencode (.torrent file format) reader/writer.
- biniou ★27 – Extensible binary data format, like JSON but faster.
- jsonm — Non-blocking streaming JSON codec for OCaml.
- xmlm — A streaming codec to decode and encode the XML data format.
- yojson ★102 — An optimized parsing and printing library for the JSON format.
- sexplib ★72 – A S-expression parser and printer
- Mirage OS ★1086 – Mirage is a programming framework for constructing secure, high-performance network applications across a variety of cloud computing and mobile platforms.
- ocaml-fat ★11 – Read and write FAT format filesystems from OCaml.
- ocaml-git ★186 – Pure OCaml low-level git bindings.
- ocaml-vchan ★25 – Pure OCaml implementation of the “vchan” shared-memory communication protocol.
- Alcotest ★0 – A lightweight and colourful test framework.
- OUnit – OUnit is a unit test framework for OCaml. It allows one to easily create unit-tests for OCaml code. It is based on HUnit, a unit testing framework for Haskell.
- QCheck ★76 — QCheck is a property testing library inspired from Haskell’s QuickCheck
- iTeML (formerly known as qtest) — supports inline pragma’s to generate tests.
- Kaputt — comprehensive testing framework.
- Pa_test — General inline testing macro’s.
- TestSimple ★7 ⏳3Y - A lightweight unit testing framework compatible with the Test Anything Protocol.
- Opium ★341 – Sinatra like web toolkit for OCaml.
- Ocsigen Eliom – Eliom is a full-featured multi-tier framework, for developing multi-platform Web and mobile apps as 100% OCaml distributed applications. It can also be used for more traditional Web or mobile apps: Web sites, single page applications, REST API, etc.
- Ohm - Ohm was an open source web framework for the OCaml language which is now dead.
- webmachine ★145 – A REST toolkit for OCaml. OCaml webmachine is a layer on top of cohttp that implements a state-machine-based HTTP request processor. It’s particularly well-suited for writing RESTful APIs. As the name suggests, this is an OCaml port of the webmachine project.
- COW ★79 – Caml on the Web (COW) is a set of parsers and syntax extensions to let you manipulate HTML, CSS, XML, JSON and Markdown directly from OCaml code.
- Ocamlnet has many relevant web libraries — Nethtml html parser, Netasn1 for ASN.1 parsing, Netencoding for Base64, Quoted Printable, URL encoding and HTML escaping, Netmime for MIME processing, etc. See the list of modules in Ocamlnet’s manual.
- tyxml — Library to build valid (according to the W3C spec) Html and Svg trees.
- commonjs_of_ocaml ★10 ⏳2Y - Easily import and export CommonJS modules from a js_of_ocaml project.
- ocaml-uri ★50 – RFC3986 URI parsing library.
- Syndic ★21 – RSS and Atom feed parsing
- ocaml-mustache ★35 – mustache.js logic-less templates in OCaml.
- atdjs ★10 ⏳4Y – atd code generator for OCaml/js_of_ocaml.
- jingoo ★58 – OCaml template engine almost compatible with jinja2.
- dispatch ★25 – Path-based dispatching for client- and server-side applications.
- Lambda Soup ★175 - Functional HTML scraping and manipulation with CSS selectors, à la Python’s Beautiful Soup.
- Markup.ml ★83 - Error-recovering streaming HTML5 and XML parsers, serializers.
Open Source Projects:
- Cumulus ★38 ⏳3Y – Hacker news like website with the OCaml framework Ocsigen
Inspired by awesome projects line. Discover more awesomeness ★21639 .
This list is a copy of rizo/awesome-ocaml with ranks