Everything you'll ever need on the road to mastering OCaml.
A curated list of references to awesome OCaml tools, frameworks, libraries and articles. Additionally there is a collection of freely available books , papers and presentations .
A community-driven review of the current state of the OCaml ecosystem and its suitability for various programming domains and tasks can be found in:
Your favorite package is not listed? Fork and create a Pull Request to add it!
If you are beginner and want to learn the basics of OCaml programming here is the Beginner's guide to OCaml beginner's guides .
- Community
- Algorithms and Data Structures
- Application Libraries
- Blogs
- Books
- Code Analysis and Linters
- Compilers and Compiler Tools
- Concurrency
- Databases
- Developer Tools
- Exercises
- Formal Software Verification
- General
- Graphics
- Language-related
- Logging
- Metaprogramming
- Mobile Applications
- Networking
- Online Courses
- Package Management
- Parallelism
- Questions
- Regular Expressions
- Science and Technical Computing
- Security
- Semantic Technology
- Serialization
- System Programming
- Testing
- Web Development
- Comparing a Machine Learning Algorithm Implemented in F# and OCaml
- OCamlgraph – A generic graph library for OCaml. ★ 62, pushed 133 days ago
- ods – A large collection of data structures and algorithms for OCaml. ★ 7, pushed 364 days ago
- combine – OCaml library for combinatorics https://www.lri.fr/~filliatr/combine/ . ★ 11, pushed 130 days ago
- Batteries Included – A community-maintained foundation library for your OCaml projects. ★ 240, pushed 131 days ago
- Cmdliner – Declarative definition of command line interfaces for OCaml. ★ 34, pushed 131 days ago
- Core – Jane Street Capital's standard library overlay. ★ 367, pushed 130 days ago
- React – React is an OCaml module for functional reactive programming (FRP). It provides support to program with time varying values: declarative events and signals.
- ctypes – Library for binding to C libraries using pure OCaml. ★ 122, pushed 129 days ago
- easy-format – Pretty-printing library for OCaml. ★ 11, pushed 272 days ago
- ocaml-rpc – Light library to deal with RPCs in OCaml. ★ 25, pushed 410 days ago
- ocaml-containers – A small standard library extension, string library, and (in "misc") a bunch of random things of lower quality. BSD license. ★ 89, pushed 132 days ago
- Notty - Notty is a declarative terminal library for OCaml, structured around a notion of composable images.
- 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 .
- 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.
- Mascot - Mascot is a style-checker for OCaml sources
- pfff – 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. ★ 1653, pushed 161 days ago
- infer - infer is a static analyzer for Java, C and Objective-C ★ 5107, pushed 129 days ago
- flow - flow is a static type checker for JavaScript ★ 7083, pushed 127 days ago
- Ocamllint - Ocamllint detects common errors in OCaml code
- BetterErrors - BetterErrors improves error messages of the OCaml compiler (Make OCaml Errors Great Again.)
- SLAyer - SLAyer is an automatic formal verification tool that uses separation logic to verify memory safety of C programs.
-
Compilers Written in OCaml
:
- 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 – A Lisp on LLVM written in OCaml. ★ 552, pushed 523 days ago
- Rust Programming Language - Originally written in OCaml before bootstrapping.
- Quick C-- Target Language - It is now a dead project. Github Repo . Alternative website .
- tis-interpreter - An interpreter for finding subtle bugs in programs written in standard C
- Others - Some other compilers implemented in OCaml, quite a few dead now.
-
Parser and Lexer Generators
:
- Opal – Self-contained monadic parser combinators for OCaml.
- Menhir – Menhir is a LR(1) parser generator for OCaml.
- ocamllex/ocamlyacc – lex and yacc implementation for OCaml.
- Angstrom - Parser combinators built for speed and memory efficiency
- Articles :
- Async — A monadic concurrence library to go with the Core library.
- Cooperative Concurrency in OCaml: A Core.Std.Async Example .
- Lwt — A cooperative threads library for OCaml.
-
Bindings
- Dbm — A binding to the NDBM/GDBM Unix "databases".
- Mongo.ml – An OCaml driver for Mongodb
- PG'OCaml — PG'OCaml provides an interface to PostgreSQL databases for OCaml applications.
- SQLite3 — OCaml bindings to the SQLite3 database.
- Sqlite3EZ — Thin wrapper for SQLite3 with a simplified interface.
- ocaml-redis – Redis bindings for OCaml. ★ 16, pushed 126 days ago
- mysql – Bindings to libmysqlclient for interacting with MySQL databases.
- mysql_protocol – Implementation of MySQL Protocol with the Bitstring library. ★ 5, pushed 204 days ago
- New Implementations ★ 544, pushed 128 days ago
- Overlays ★ 22, pushed 199 days ago
- Articles :
- Try OCaml – Try OCaml in your web browser.
- iocaml – An OCaml kernel for the IPython notebook. ★ 95, pushed 143 days ago
- utop – Universal toplevel for OCaml with support of multiline edition, history, real-time and context sensitive completion, colors, and more. ★ 245, pushed 133 days ago
- ocp-browser — Small ncurses-based API and documentation browser. Provided with ocp-index.
- 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 – A command-line tool to manage Github Issues. ★ 12, pushed 852 days ago
- OCaml Yeoman Generator – Yeoman generator to scaffold OCaml modules. ★ 13, pushed 168 days ago
-
Foreign Function Interface
:
- ocaml-main-program-in-c – Example build system for making mixed C/Ocaml binaries where the main program is in C.
- Modular foreign function bindings
-
Editor Plugins
:
- merlin – Context sensitive completion for Ocaml in Vim and Emacs.
- tuareg - OCaml mode for Emacs that can run the toplevel and the debugger within Emacs. ★ 107, pushed 150 days ago
- Sublime better ocaml — Better OCaml mode for Sublime Text. ★ 7, pushed 371 days ago
- Sublime text package
- ocp-index — Easy access to the interface information of installed OCaml libraries for editors like Emacs and Vim.
- Sublime text package
- ocp-indent — Indentation tool for OCaml, to be used from editors like Emacs and Vim.
- Vim interface .
-
Code coverage
- Bisect
- Bisect_ppx a more recent fork of the previous tool. ★ 1, pushed 17 days ago
- 99 problems . 99% solutions are here .
- 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 .
- 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 – OCaml library for reading, writing and modifying PDF files. ★ 44, pushed 155 days ago
- capnp-ocaml 2.0: The Road to Unembarrassing Performance
- slacko – A neat interface for Slack in OCaml. ★ 25, pushed 127 days ago
- Learn X in Y minutes - Where X=OCaml.
-
2D
- archimedes — 2D plotting library.
- cairo2 — Binding to Cairo, a 2D Vector Graphics Library. Integrates well with lablgtk. ★ 11, pushed 385 days ago
- Vg – Declarative 2D vector graphics for OCaml. ★ 35, pushed 388 days ago
- 3D
-
GUI
- lablgtk — GTK2 bindings for OCaml with various higher-level facilities to define GUIs.
- lablqt – Qt5 bindings for OCaml. ★ 53, pushed 140 days ago
- 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.
- Higher-Rank Polymorphism in OCaml
- mikmatch – OCaml pattern-matching extended with regexps ★ 16, pushed 192 days ago
- Inlined records in constructors
- Algebraic Data Types
- XEN – OCaml Best Practices for Developers
- OCaml Style Guide - See also: [1] , [2] , [3] . ★ 5, pushed 596 days ago
- A safe but strange way of modifying OCaml compiler
- Fiddling with the OCaml Type System
- dolog – A dumb OCaml logger. ★ 17, pushed 327 days ago
- Volt – A variant of Bolt OCaml logging tool. ★ 2, pushed 1182 days ago
- Logs - Logs provides a logging infrastructure for OCaml.
- Articles :
-
Syntax Extensions
:
- ppx import – Import is a syntax extension that allows to pull in types or signatures from other compiled interface files.
-
ppx
string
interpolate
– A simple ppx filter to support string interpolation like
[%str "value of foo is $(foo)"]
. ★ 6, pushed 675 days ago - ppx ★ 23, pushed 612 days ago
- 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.
- Articles :
-
Bindings
:
- Cordova plugins – List of bindings to Cordova plugins. Get access to native device components like accelerometer, SMS, geolocation, etc in OCaml.
-
HTTP Tools
:
- ocaml-cohttp – Very lightweight HTTP server using Lwt or Async.
- ocurl – OCaml bindings to libcurl. ★ 17, pushed 128 days ago
- ZeroMQ Bindings : ★ 29, pushed 152 days ago
- ocaml-dns – A pure OCaml implementation of the DNS protocol. ★ 32, pushed 141 days ago
- onanomsg – nanomsg bindings for OCaml. ★ 25, pushed 138 days ago
- fluent-logger – Fluentd logger for OCaml. ★ 3, pushed 737 days ago
- 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
-
Distribution :
- OPAM – A flexible Git-friendly package manager with multiple compiler support.
- ocamlfind — Local OCaml library manager. Used by most of the OCaml ecosystem.
- WODI for Windows - A package manager for Windows.
- makorel – Release OPAM packages easily. ★ 7, pushed 630 days ago
-
Build Tools :
- 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 — Tool to convert OASIS metadata to OPAM package descriptions. ★ 18, pushed 171 days ago
- obuild – Simple package build system for ocaml. ★ 37, pushed 155 days ago
- jenga – Monadic build system from Jane Street. ★ 30, pushed 130 days ago
- ocamlbuild — Build system provided with the compiler.
- ocaml-makefile — Easy to use Makefile for small to medium-sized OCaml-projects. ★ 26, pushed 143 days ago
- topkg — OPAM-aware packaging system using ocamlbuild. ★ 34, pushed 131 days ago
- Namespaces - ocamlbuild plugin that converts your directory tree into nested modules.
( Note: Sorted from the easier to use to the more flexible. )
-
Libraries :
- Parmap — Provides easy-to-use parallel map and fold functions.
- ForkWork — A simple library for forking child processes to perform work on multiple cores. ★ 17, pushed 1226 days ago
- Functory — A distributed computing library which facilitates distributed execution of parallelizable computations in a seamless fashion.
- Rpc.Parallel — A library for spawning processes on a cluster of machines, and passing typed messages between them. ★ 21, pushed 130 days ago
-
Ocamlnet
— An enhanced system platform library. Contains the
netmulticore
library to compute tasks on as many cores of the machine as needed. - Nproc – Process pool implementation for OCaml. ★ 24, pushed 1103 days ago
-
Articles :
- biocaml – OCaml Bioinformatics Library http://biocaml.org . ★ 60, pushed 130 days ago
- guizmin – OCaml library for building bioinformatics pipelines. ★ 4, pushed 310 days ago
- lacaml - OCaml bindings for BLAS/LAPACK (high-performance linear algebra Fortran libraries).
- onumerical – Numerical library for OCaml. ★ 7, pushed 885 days ago
- oml - OCaml library for general numerical work. ★ 71, pushed 144 days ago
-
ocephes
- Bindings to frequently used
C
special funcitons library. ★ 8, pushed 223 days ago
- Re – a pure OCaml regular expressions library with combinators, supporting several formats (glob, posix, str...) ★ 61, pushed 164 days ago
- ocaml-pcre – bindings to the PCRE library (perl-compatible regular expressions) ★ 11, pushed 193 days ago
- Humane-re – Humane-re attempts to provide an easy interface for 90% of your regex needs Courtesy of ocaml-re ★ 16, pushed 386 days ago
- Tyre - Tyre is a set of combinators to build type-safe regular expressions, allowing automatic extraction and modification of matched groups.
- ocaml-tls – TLS in pure OCaml. ★ 147, pushed 127 days ago
- OCaml-RDF – OCaml library to manipulate RDF graphs and execute Sparql queries.
- bencode — Bencode (.torrent file format) reader/writer. ★ 5, pushed 658 days ago
- biniou – Extensible binary data format, like JSON but faster. ★ 16, pushed 138 days ago
- jsonm — Non-blocking streaming JSON codec for OCaml.
- xmlm — A streaming codec to decode and encode the XML data format.
- yojson — An optimized parsing and printing library for the JSON format.
- sexplib – A S-expression parser and printer ★ 41, pushed 130 days ago
- Mirage OS – Mirage is a programming framework for constructing secure, high-performance network applications across a variety of cloud computing and mobile platforms. ★ 657, pushed 127 days ago
- ocaml-fat – Read and write FAT format filesystems from OCaml. ★ 8, pushed 515 days ago
- ocaml-git – Pure OCaml low-level git bindings. ★ 39, pushed 128 days ago
- ocaml-vchan – Pure OCaml implementation of the "vchan" shared-memory communication protocol. ★ 19, pushed 151 days ago
- Alcotest – A lightweight and colourful test framework. ★ 0, pushed 133 days ago
- 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 — QCheck is a property testing library inspired from Haskell's QuickCheck ★ 27, pushed 169 days ago
- iTeML (formerly known as qtest ) — supports inline pragma's to generate tests. ★ 22, pushed 133 days ago
- Kaputt — comprehensive testing framework.
- Pa_test — General inline testing macro's.
- TestSimple - A lightweight unit testing framework compatible with the Test Anything Protocol . ★ 6, pushed 555 days ago
-
Frameworks :
- Opium – Sinatra like web toolkit for OCaml.
- Eliom – Eliom is a framework for programming web sites and client/server web applications. It uses very new concepts making programming very different from all other web programming tools, and allowing to write a complex web site in very few lines of code.
- Ohm - Ohm was an open source web framework for the OCaml language which is now dead.
- webmachine – 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. ★ 50, pushed 166 days ago
-
Tools :
- COW – 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.
- js of ocaml – Js of ocaml is a compiler of OCaml bytecode to Javascript. It makes it possible to run Ocaml programs in a Web browser.
- BuckleScript - BuckleScript is backend for OCaml to generate debuggable Javascript. It enables OCaml to integrate Javascript platform in a seamless way. ★ 653, pushed 129 days ago
- ocaml-uri – RFC3986 URI parsing library. ★ 31, pushed 158 days ago
- Goji – An OCaml bindings generator for JavaScript libraries. ★ 25, pushed 772 days ago
- Syndic – RSS and Atom feed parsing ★ 17, pushed 153 days ago
- ocaml-mustache – mustache.js logic-less templates in OCaml. ★ 21, pushed 141 days ago
- atdjs – atd code generator for OCaml/js of ocaml. ★ 8, pushed 1075 days ago
- jingoo – OCaml template engine almost compatible with jinja2. ★ 42, pushed 212 days ago
- dispatch – Path-based dispatching for client- and server-side applications. ★ 14, pushed 292 days ago
- Lambda Soup - Functional HTML scraping and manipulation with CSS selectors, à la Python's Beautiful Soup. ★ 70, pushed 143 days ago
- Markup.ml - Error-recovering streaming HTML5 and XML parsers, serializers. ★ 45, pushed 136 days ago
-
Open Source Projects :
- Cumulus – Hacker news like website with the OCaml framework Ocsigen
Inspired by awesome projects line. Discover more awesomeness ✨.