21

I like F# but sometimes I need something light and cross-platform and without .NET for sure. I tried to use OCamL many times but seems like I just can't start it.

  1. Installed IDEA, added OCamL plugin -> Doesn't work
  2. Installed eclipse ODT plugin -> Can't launch even config OCamL compiler - too complicated
  3. Even had tried NetBeans plugin a long time ago but even can't deal with it.

So, for now, I'm using ocamlc -o "main.exe" "main.ml" from the command shell and different light editors. I don't use Vim or Emacs, I'm using nano and I have a habit of usage full-featured IDEs.

I found various documentation (this is looking like the best to start http://caml.inria.fr/pub/docs/oreilly-book/html/index.html for me) but still being confusing when looking for something a bit specific alike sqlite access. found this: http://neugierig.org/software/ocaml/sqlite/ with strange api annotation and no examples. And all the documentation about IDE usage I found are outdated or doesn't work.

Addition subquestion: some people told me "don't use OCamL, it's a dead language for students with low libraries support and seems like dying, use python or ruby instead". But I like the beauty of OCamL. I want to give it a try. Tell me if that is normal to use OCamL for production code today?

thank you.

denis631
  • 1,765
  • 3
  • 17
  • 38
cnd
  • 32,616
  • 62
  • 183
  • 313
  • 5
    As someone who programs in OCaml for a living, I can assure you that it is not dead. Here is this month's manifestation that it is still doing well: http://dl.acm.org/ft_gateway.cfm?id=2038036&type=pdf I hope that next month's manifestation will be a new release of the software I work on full time with ~10 others. – Pascal Cuoq Sep 28 '11 at 16:48
  • 3
    My answer [can be found here](http://stackoverflow.com/questions/14747939/ide-for-ocaml-language) -- make sure to take a look at [OCaml-top](http://www.typerex.org/ocaml-top.html) and [Merlin](https://github.com/def-lkb/merlin). – lukstafi Oct 14 '13 at 20:00

4 Answers4

16

There is TypeRex, a new development environment for OCaml. Here is a summary of TypeRex features:

  • Improved syntax coloring
  • Auto-completion of identifiers (experimental)
  • Browsing of identifiers: show type and comment, go to definition, cycle between alternate definitions, and semantic grep;
  • Strictly semantic-preserving, local and whole-program refactoring:
    • renaming identifiers and compilation units
    • open elimination and reference simplification
  • Robust w.r.t. not-recompiled, possibly unsaved buffers
  • Scalable (used regularly on a few hundreds of source files)

There are some screenshots available on the website. The first release candidate is out since yesterday.

EDIT: The first release (v1.0) is out now :-)

Çağdaş Bozman
  • 2,537
  • 16
  • 21
  • 1
    Too bad v1 only works with emacs (and only for linux). – Pat Feb 06 '13 at 20:21
  • 1
    Calling TypeRex an IDE is a bit of stretch, it is just a bunch of tools and libraries to support development in OCaml. As of today there are no IDEs available for OCaml. – codelion Aug 07 '14 at 02:32
7

There are a few options:

  1. Tuareg for emacs was already mentioned: http://tuareg.forge.ocamlcore.org/
  2. vim has a few options for OCaml integration, with one good example available here: http://www.ocaml.info/software.html#vim
  3. OcaIDE seems to be the best option for Eclipse: http://www.algo-prog.info/ocaide/
  4. Geany, Komodo Edit and a number of other editors have syntax highlighting support for OCaml and some extra IDE-like features which are independent of the programming language being used. Most of these have limited OCaml-specific support.

OCaml is not dead. Some of the more vocal industry users of OCaml are XenSource/Citrix and Jane St. Capital. The language does not receive the same public and community evangelism that some other languages receive.

Pat
  • 16,515
  • 15
  • 95
  • 114
hcarty
  • 1,671
  • 8
  • 8
3

It's been years, but I really liked emacs' tuareg mode http://tuareg.forge.ocamlcore.org/

But if you're afraid of emacs, then it's not the right tool.

I specially like the shell integration and the possibility to "throw" a function you're developping in the shell and then test it.

EDIT For the subquestion, OCaml seems dead, and it's a pitty. However you cannot compare it with ruby/python. I'd say it's main competitor is Haskell which seems to be growing in popularity.

Tristram Gräbener
  • 9,601
  • 3
  • 34
  • 50
  • But is it possible to work with many different files there ? I used Geany for a while. Isn't it better ? – cnd Sep 28 '11 at 11:32
  • Well, emacs is a huge thing (trolls like to say it's almost an OS) and has a steep learning curve. So yes, you can edit multiple files. I don't know how easily you can jump from one file to another (like "go to the definition of the function under my cursor"). – Tristram Gräbener Sep 28 '11 at 11:37
  • to EDIT: but there are many ocaml based projects. And I'm not sure about Haskell. I had a try to use Haskell but it's really different. – cnd Sep 28 '11 at 11:52
  • 25
    I absolutely don't agree that Ocaml is dead. While the language itself is not changing much (which is a *good* thing, it means it's stable) there are new projects developed in Ocaml, check for instance: http://opalang.org, http://www.janestreet.com. – akoprowski Sep 28 '11 at 12:26
  • I hope I'm wrong :) As I said, it's been a while I had an occasion to work with Ocaml, I my impression could be wrong – Tristram Gräbener Sep 28 '11 at 14:38
  • I don't agreed with that no changes is good thing. There is nothing perfect specially when we talk about such thing as OCamL compiler. But I really hope that OCamL is not dead. – cnd Sep 28 '11 at 17:37
  • to EDIT: ocaml is never dead. It's the best existing functional programming language until now – bobzhang Jun 09 '12 at 13:56
  • 4
    I don't think we can easily say OCaml is dead. In fact, it might have the largest industrial userbase of all the functional languages. I know it's used heavily at Jane Street, who also developed the Core library (their own version of the standard library) and Async. Real World OCaml is about to be released as well, similar to the book Real World Haskell, which might hopefully jump-start interest in the language. – Zach Conn Oct 08 '12 at 02:59
-3

Googling "ocaml ide" shows now http://camelia.sourceforge.net/ as the first result. Haven't tested it though, so I can't really say if it is recommendable or not.