https://ocaml.org OCaml logo OCaml logo * Learn * Packages * Community * Blog * Playground [ ] Get Started * [logo-with-name] * [ ] * Learn * Packages * Community * * Blog * Playground * Get started * General-Purpose, Industrial-Strength, Expressive, and Safe OCaml is a general-purpose, industrial-strength programming language with an emphasis on expressiveness and safety. Get started About OCaml let square x = x * x val square : int -> int = < fun > square 3 - : int = 9 let rec fac x = if x <= 1 then 1 else x * fac (x - 1) val fac : int -> int = < fun > fac 5 - : int = 120 square 120 - : int = 14400 Try the Playground Trusted by Industry Leaders These companies and organisations rely on OCaml every day -- along with thousands of other developers. See Success Stories Facebook Microsoft Docker Jane Street Bloomberg Tezos Ahrefs BE SAFE Unobtrusive Type Safety OCaml's powerful type system means more bugs are caught at compile time, and large, complex codebases are easier to maintain. This makes it a good language for running critical code. At the same time, sophisticated inference makes the type system unobtrusive, creating a smooth developer experience. An example OCaml program defining nested lists in OCaml. A terminal output also shows the compiler catching a type error where a pattern-match was not exhaustive. BUILD FASTER Fast Compiler and Efficient Applications OCaml has two compilers. One is a bytecode compiler which generates small, portable executables and is very fast. The other is a native code compiler that produces more efficient machine code; its performance matches the highest standards of modern compilers. [workfaster] WORK JOYFULLY First-Class Editor and Tooling OCaml has great support for the most popular editors. VS Code is recommended for beginners, and for power users there is deep integration with Vim and Emacs. OCaml has a rich and dynamic community and best-in-class tooling. Between Opam, a popular package manager; Utop, a powerful interactive REPL; and odoc, an easy-to-use documentation generator, OCaml programmers have access to a complete, modern developer experience. [vscode] [vim] [emacs] An OCaml program being edited in VSCode Writing an OCaml program using emacs Writing an OCaml program using vim Vibrant Community OCaml has a passionate and diverse community, with more than ten thousand developers and four thousand open source packages. It is a truly general-purpose language with extensive libraries in a variety of problem areas, including data science, bioinformatics, and programming language design. OCaml has roots in academic and theoretical contexts but has also become popular among application developers looking to build command-line utilities or performant, dynamic web apps without resorting to a less safe or feature-rich language. MirageOS logo MirageOS Library operating system to constructs unikernels Js_of_ocaml logo Js_of_ocaml Compiler from OCaml to Javascript. Cmdliner logo Cmdliner Declarative definition of command line interfaces for OCaml Irmin logo Irmin Distributed database that follows the same design principles as Git Dune logo Dune A composable build system for OCaml Lwt logo Lwt OCaml promises and concurrent IO Owl logo Owl OCaml Scientific and Engineering Computing Dream logo Dream Tidy Web framework for OCaml and ReasonML Users of OCaml OCaml is used by thousands of developers, companies, research labs, teachers, and more. Learn how it fits your use case. For Educators With its mathematical roots, OCaml has always had strong ties to academia. Currently, it is being taught in universities around the world, and has accrued an ever-growing body of research. This page will provide you with an overview of the academic rigor that defines the culture of OCaml. Learn more For Industrial Users With its powerful compile-time guarantees and high performance, several companies rely on OCaml to keep their systems operating both reliably and speedily. On this page, you can get an overview of the companies in the community and learn more about how they use OCaml. Learn more Curated Resources Get up to speed quickly to enjoy the benefits of the OCaml programming language across your projects. Getting Started Install OCaml, set up your favorite text editor and start your first project. Language Manual Read the reference manual of the language and documentation on the compiler. Books What expert programmers and researchers are saying about OCaml, from the beginner level to more advanced topics. Standard Library Searchable API documentation. Exercises Learn OCaml by solving problems on a variety of topics, from easy to challenging. Papers Papers that have influenced OCaml and other functional programming languages. OCaml Packages Explore thousands of open-source OCaml packages with their documentation. Explore packages [packages-home] [logo-with-name] Innovation. Community. Security. * About Us * Industrial Users * Academic Users * Why OCaml * Resources * Get Started * Language Docs * Books * Releases * Community * Blog * Opportunities * Legal * Carbon Footprint * Governance * Privacy Policy