Skip to content

Instantly share code, notes, and snippets.

@btbytes
Last active January 22, 2017 02:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save btbytes/30a10bc98db4a413ddb3 to your computer and use it in GitHub Desktop.
Save btbytes/30a10bc98db4a413ddb3 to your computer and use it in GitHub Desktop.
OCaml as a replacement for Go

OCaml as a replacement for Go

What is go good at and how ocaml measures up in terms of being better alternative for Go.

Go was written to do one thing really well - write network applications. Can OCaml Compete here?

Speed of the executable

Speed of compilation

Generated binary size

Concurrency

OCaml has GIL,

Go has Channels

Editors

Tooling - compilers

Tooling - build tools

Go has go make(?), OCaml has ocp-build

Tooling - sandbox/virtualenvironments

Tooling - package managers

Libraries

Core libraries

  • What about "Batteries"?
  • What about "Standard" libraries?

HTTP

CoHTTP -- lightweight HTTP server using Lwt or Async.

Database libraries

Web - Javascript

  • js_of_ocaml

Code formatting

Go has go fmt, OCaml has ocp-indent

C interop

You can mix C object files and OCaml files together on the linker command line rwmj

Documentation

OCaml has lot more books, papers and courses teaching OCaml, SML, F# and related languages.

Where OCaml needs to catch up

.. and what is being done:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment