OCaml, eclipse, ekiga…

November 17, 2007

Last time I blogged about how python saved my day, but I didn’t really enjoy the experience : by itself, the language will discover huge mistakes only when hitting the right code path. Yes, I know : “Use unit testing!”. Right. For me unit testing is about checking corner cases are handled correctly, not about checking the code even makes sense. It’s about making something 90% correct go 99.999% correct.

So I turned again to a stronger language, one which will tell me exactly how wrong my code is (and where and why) the minute I write it : ocaml.

Of course, as I said last time, it lacks decent XML support : it does have simple parsers, but nothing serious : if you load an XML file, you can’t really edit it in-place. You have to save by yourself, which means if you parse something like <foo detail='bar'>...</foo>… but only know about the foo tag without detail, then you will save without the unsupported attribute and same problem if there’s an unsupported child.

Still, as I have hope that things will improve (well, I may even have a hand in it), I went forward.

I even discovered OcaIDE, an eclipse plugin for OCaml, which works pretty well with gcj, but with a pretty annoying performance issue on the completion — which disappears with sun’s virtual machine (problem reported).

Together with the new ocamlbuild tool, which takes care of most of the dependency tracking, things went fast : I have almost duplicated the python features I already had. A little because I factored things a little differently, but mostly because I was discovering eclipse, ocamlide and ocamlbuild (with python I was just discovering the specific modules I was using : I knew emacs already, and the module system).

Of course, things would go faster if I stopped requesting assignments from my students every week… which means reading and annotating like crazy.

I also brought back to life the skeleton of ekiga’s future call history, which had been compiled out since a few weeks… and I learnt I would have to rewrite the evolution-data-server at least partially. Sigh.

5 Responses to “OCaml, eclipse, ekiga…”

  1. Stu Says:

    I’ve only really started using unit testing, but have setup really basic ones that just construct the things I need. They do seem to help when I change stuff, which is often enough.

  2. smimou Says:

    You might be interested in CDuce (http://www.cduce.org/) to make type-safe manipulations of XML documents in OCaml.

  3. Snark Says:

    Looks nice, but if I read it well, CDuce is an OCaml-ish language, but isn’t OCaml… isn’t it?

  4. smimou Says:

    Well, ocamlduce is effectively an ocaml-ish language but cduce is only an OCaml library.

  5. Snark Says:

    Hmmm… I read a little on CDuce’s site, and it really looks like CDuce isn’t just an OCaml library.


Leave a Reply

You must be logged in to post a comment.