Alternatives to OCaml

A functional programming language with a strong static type system and a native-code compiler. The listings below can replace it for an important use case. Each note says what changes if you switch.

The original

Replacements

Listings that take over the same core job as OCaml.

  • Scala

    A programming language that combines object-oriented and functional programming, targeting the JVM and web.

    Scala combines functional and object-oriented programming on the JVM with access to Java libraries, and also targets the web through Scala.js.

  • Gleam

    A type-safe functional programming language that runs on the Erlang VM and JavaScript runtimes.

    Gleam is a younger type-safe functional language that runs on the Erlang VM and JavaScript, with compiler, build tool and package manager in one.

  • Rust

    A compiled systems programming language with no garbage collector, installed through the rustup toolchain manager.

    Rust is a compiled systems language with strong static types and compile-time memory safety, but its ownership model takes time to learn.

  • Elixir

    A dynamic, functional programming language that runs on the Erlang VM for scalable, maintainable applications.

    Elixir is a functional language on the Erlang VM with a gradual type system rather than OCaml's strict static typing, suited to concurrent back-end systems.

Similar software

Related functionality, not a direct replacement.