Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@btbytes
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save btbytes/af9c7f8203d0a176d61e to your computer and use it in GitHub Desktop.
Save btbytes/af9c7f8203d0a176d61e to your computer and use it in GitHub Desktop.
What OCaml can learn from Go

Editor support

Embrace newer editors like Sublime Text over traditional favourites like vim and Emacs

Gosublime works very well with sublime, which is a very good programmer's text editors by all accounts. OCaml has https://github.com/whitequark/sublime-better-ocaml. The problems with 'better-ocaml' are:

  • it does not recognize opam

OCaml's build system is complicated

lot of complicated looking makefiles. Compare with go build.

Packaging OCaml is not easy.

Compare with Go's - github.com/USER/PACKAGE.

What is the right project structure for OCaml?

Are there are any tools that can autogenerate a project structure

  • see haskell-cabal's - cabal init
  • python paster
  • NOTE: looks like you can ignore this safely for now. duplicates ocamlfind, and ocamlfind is the "preferred" way.
  • is a build system.
  • uses a config file that is similar to .cabal file.
  • is tool to integrate a configure, build and install system in your OCaml project. It helps to create standard entry points in your build system and allows external tools to analyse your project easily.
  • target OCamlBuild
  • takes ideas from Cabal.

Sublime text 3 and OCaml

uses ocp-index library to provide easy access to the information contained in your OCaml cmi/cmt/cmti files. It is used to provide features like library interface browsing, auto-completion, show-type and goto-source.

If the ocp-index is too old, s-o-i does not work, so use the trunk version thusly:

opam pin ocp-index git://github.com/OCamlPro/ocp-index

Merlin

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