An industrial-strength functional programming language with an emphasis on expressiveness and safety
open sourceLGPL-2.1-only WITH OCaml-LGPL-linking-exceptionfree
OCaml is a statically typed functional language with type inference, algebraic data types and pattern matching, parametric polymorphism, a module system and an object system, and strict evaluation that keeps runtime behaviour predictable. Its compiler has two back ends: a bytecode compiler that makes small, portable executables, and a native code compiler that produces efficient machine code; an incremental generational garbage collector manages memory, and OCaml 5 added multicore support. The ecosystem around it includes opam (the package manager), Dune, the utop REPL, odoc and editor integrations for VS Code, Vim and Emacs. Written in 1996 at Inria, it has a release every year; the core system is LGPL-2.1 with a static linking exception.
Libraries for OCaml
Browse all of them: 1 library.
Problems it solves
- a functional language with a strong type system that catches bugs at compile time
- write a compiler, interpreter or static analysis tool in a language suited to it
- a fast compiled language with garbage collection and predictable performance
- model complex data with algebraic types and pattern matching
- refactor a large, complex codebase with confidence that the types will catch mistakes
- a mature functional language used in finance and systems software
- type inference so I don't have to annotate every variable
Features
- static typing with type inference
- algebraic data types and pattern matching
- parametric polymorphism and a powerful module system
- object system with strongly typed objects
- bytecode compiler for portable executables and native code compiler for machine code
- incremental generational garbage collector
- multicore support since OCaml 5.0
- opam package manager, utop REPL and odoc
- a long term support release (4.14)
Capabilities
| Has a command line tool | plan not known |
|---|
Alternatives
The same job
These do what OCaml does.
- Roc A fast, friendly, functional language
- Rust A language empowering everyone to build reliable and efficient software.
- Go Build simple, secure, scalable systems with Go
- Haskell Enjoy long-term maintainable software you can rely on
- Swift A general-purpose programming language that's approachable for newcomers and powerful for experts
- C# A modern, open-source programming language