Fast and reliable programs with OCaml
Summary
Compared with Python, OCaml is a lot faster, and static checking makes code more reliable and easier to refactor. However, the syntax is less consistent, and syntax errors are harder to track down. Compared with Java, OCaml's type checking is better (no NullPointerException
!), the code is much less verbose, and startup time and memory usage are lower. However, you do lose Java's binary compatibility: OCaml libraries must be recompiled when their dependencies change. Compared with Haskell, OCaml is easier to learn. It provides familiar constructs like while
loops, mutable variables, and classes, making it straightforward to port existing code to OCaml. OCaml, however, lacks Haskell's type classes for convenient overloading.
OCaml is a very practical language for writing Linux applications, services, and utilities. It's reliable, fast, easy to learn, and fun to use. Additionally, it has many libraries available, can call C code easily (with ocaml-ctypes
), and has a helpful and friendly community.
Infos
- OCaml: http://ocaml.org/
- OPAM: http://opam.ocamlpro.com/
- Blog: http://roscidus.com/blog/
« Previous 1 2 3 4 5
Buy this article as PDF
(incl. VAT)