This page describes the current state of the OCaml ecosystem.
- The OCaml Platform: a community endeavor to standardize the infrastructure in the OCaml world.
For a list of things currently missing in OCaml’s ecosystem, see Missing Pieces
For an overview of the different standard library options and recommendations, see Standard Libraries.
Data Structures and Common Algorithms
- A major part of a standard library’s role is providing basic data structures and algorithms. All the standard libraries (Containers, Base, Core and Batteries) provide both.
- OCamlGraph is a library for graphs and graph algorithms.
- ods is an algorithm/data structure library, though it isn’t as fully-featured as the standard libraries.
- Discrete Interval Encoding Trees: Useful for storing interval sets and testing membership efficiently.
- Interval: An interval arithmetic library.
Build System/Package Management
- aws-s3: Access to Amazon’s Simple Storage Solution (S3)
- Google Drive OCamlFuse: A User file system for Google Drive. Also one of the few ways to sync Google Drive from Linux.
See Code Tools
Command Line Arguments
- The standard library contains the Arg module, which has a simple syntax for defining command line arguments. However, it uses mutable state for arguments, and doesn’t have a built-in way to handle things such as sub-arguments, or argument aliases (long and short) for the same command, though these things can be done.
- Cmdliner is a declarative approach to laying out command-line arguments. The library uses combinators to build up the desired arguments.
- BOS - Basic OS Interaction is a general OS abstraction library which also contains a command line argument module (BOS.OS.Arg).
- Jane Street’s Core standard library contains the Command module, which takes a similar approach to Cmdliner.
- Minicli is a self-described minimalist library for command line parsing.
For compilation tools made in OCaml, see Compilers
Concurrency, Parallelism, Distributed Computing
- OCaml comes with a built-in debugger for the bytecode compiler.
You invoke it with the
ocamldebugcommand. See the manual for more details.
- The easiest way to debug OCaml code, other than inserting print statements, is choosing bytecode as your compilation target, and using teh OCaml debugger.
- Additionally, one can use
gdbto debug native code.
See Editor Support
Formal Software Verification
For manipulating different file formats from OCaml, see File Formats
File Path Manipulation
- Fpath: a cross-platform path manipulation library.
Foreign Function Interface
For integrating with C, C++, Python etc., see Foreign Function Interface
Functional Reactive Programming
For graphic libraries, see Graphics
For usage of OCaml in hardware design, see Hardware Design
- dolog: a simple OCaml logger.
- Volt: a variant of Bolt OCaml logging tool.
- Logs: provides a logging infrastructure for OCaml.
For compilation of OCaml to mobile platforms, see Mobile
For metaprogramming facilities such as PPX, camlp4 and MetaOCaml, see Metaprogramming
- Format: stdlib module using the notion of boxes to lay out pretty-printing commands. It’s recommended to use one of the abstractions below instead.
- fmt: pretty-printing library abstracting over the Format module in the stdlib.
- easy-format: a pretty-printing library for OCaml.
For support of protocols, see Protocols
- SpaceTime is integrated into the compiler and allows profiling of memory allocation.
- landmarks: a profiling library for OCaml, taking into account both memory allocation and CPU time.
- Standard tools such as gprof can also be used to debug OCaml programs.
Scientific Computing and Machine Learning
For machine learning, data science and scientific computing, see Scientific Computing
For static analysis using OCaml, see Static Analysis
For libraries related to search, see Searching
- The standard library’s String module is somewhat lacking in terms of functionality.
- Containers has an expanded String module, with iteration functions and so on. Containers strives to be backwards-compatible with the Stdlib.
- AString: another implementation of expanded string functionality, with less regard for standard library compatibility
- Bigstring: On 32-bit platforms, OCaml strings are constrained to 20MB sizes. This library allows one to handle strings of any sizes, and also to handle C-style strings as if they were OCaml strings. Built on top of BigArray, and supports memory-mapping.
- Bigstring/af: another implementation of a string overlay on top of BigArray, with similar benefits. Emphasizes speed.
For low-level systems programming, see Systems Programming
For testing frameworks in OCaml, see Testing
Time and Date
- For short-term timing requirements, Sys.time can do the job.
- mtime: wall-clock monotonic time, and the best choice for longer-running timing requirements.
- ptime: POSIX time.
For GUIs and TUIs (Terminal User Interfaces), see User Interface
Web and Networking
For libraries related to web development and networking, see Web and Networking