Ocaml Tools and Editors


#1

I just got back into Ocaml(not a ‘real’ programmer but an enthusiast ) and I’m wondering what the community uses for editors and tools.

Myself, I use Vim with merlin/ocp-indent/ocp-browser and utop and opam and OcamlBrowser but I’m curious what others use and if there are any problems with the tools or any compatibility issues between tools.

Also… Does everyone else have problems deciding when and where to make types abstract and concrete in functors?


#2

Emacs + Tuareg + Merlin (+ ocp-indent) have done very well for me.


#3

Your setup sounds reasonable. I use vim for editing with merlin, ocp-indent (automatic indentation while typing), ocamlformat (formatting via neoformat). utop + ocp-browser for exploring APIs. dune to build. All via opam of course! The combination works very well for me. I haven’t run into any major compatibility issues between these tools.

The current default ocp-indent indentation and ocamlformat indentation don’t line up perfectly but both tools are configurable enough to work around those differences and ocamlformat has a lot of new formatting configuration options coming which should make the two line up even more when configured to do so.


#4

I tried (I mean really tried) to use Emacs and just couldn’t grasp the fundamentals of that editor. I think its beyond my modest means.


#5

There is ergomacs which changes hotkeys to be more standart… And Evil mode which sets hotkeys to be more like vim


#7

Its too late… I’ve been adsorbed into the Vim collective.


#8

I never understand this kind of claim, which I see made in both directions. I know both editors and there’s very little difference in learning curve. If you can learn emacs you can learn vi, and if you can learn vi you can learn emacs.


#9

Yes, but once you’ve absorbed vi it’s difficult (for me at least) to absorb emacs (both keyboard memory and general philosophy). The main thing I miss from when I attempted my experiments using emacs is slime. There’s probably an equivalent in vi but I doubt it would be as seamlessly integrated.


#10

I use neovim and I’ve uploaded my config to my dotfiles repo. Not sure if it’s helpful to others, I had a bit of trouble getting the autocomplete stuff to work using ncm2 but it works great now.


#11

You can try deoplete-ocaml with Vim 8/NeoVim: its main benefit is that completion is asynchronous and does not block you from typing.
If you just want to try it out without configuring many things see my docker container: https://github.com/edwintorok/xs-opam-dev


#12

I mostly write Reason these days and use Sublime with the LSP plugin and reason-language-server, both of which would work when writing OCaml. Works pretty well.


#13

RLS supports the ocaml syntax now?