Live data from Hacker News

Ask Hackers: Opinions on OCaml?

news.ycombinator.com

1–10 of 42 posts

Ask Hackers: Opinions on OCaml?

#1
I've been looking into OCaml a bit, and it looks interesting. Here are two articles, one on either side of the debate (sorry haven't figured out embedded links): Stevey on OCaml (pros) - http://steve.yegge.googlepages.com/ocaml Steingold on Ocaml (cons) - http://www.podval.org/~sds/ocaml-sucks.html

Anyone here an OCaml hacker?

Re: Ask Hackers: Opinions on OCaml?

#2
I've used it.

I think OCaml would be a big win if you have your software designed all up front, and need to verify that it works correctly, e.g., avionics software. Unfortunately, avionics software development seems to be moving toward C/C++...

Re: Ask Hackers: Opinions on OCaml?

#3
There's always this: http://www.paulgraham.com/vanlfsp.html

But in general (at least from what I've observed on Hacker News), OCaml gets less love than Haskell. Actually, I don't ever remember OCaml getting love here.

This pdf is a report from the Commercial Users of Functional Programming workshop last year. There are some good stories about OCaml, Scheme, and Haskell. 20 pages but well written, reads quickly.

http://cufp.galois.com/CUFP-2007-Report.pdf

Re: Ask Hackers: Opinions on OCaml?

#4
i used ocaml very briefly so my opinion should be taken with a huge grain of salt. The language is nice. The type system is mostly pretty cool .. there were some programs that were "correct if it compiled". But sometimes the type system sometimes comes in the way .. I hear (but dont know firsthand) that Haskell's type classes alleviate some of the pain.

Re: Ask Hackers: Opinions on OCaml?

#5
I'm learning OCaml myself now. I'm actually starting a new open source database project and I intend to implement it in OCaml. I'll probably post information about the project here whenever I get it going enough to have something to discuss.

Take a look at a specialized reddit I created for OCaml discussion: http://reddit.com/r/ocaml

Re: Ask Hackers: Opinions on OCaml?

#6
Looked into it in college. I liked it a lot - it's fast, clean, safe, and has some cool features. Also was easier to learn than Haskell.

I left it behind because it was easier to learn than Haskell. I use these languages (Ocaml, Haskell, Erlang, Scheme) because they're mind-expanding. For practical programs, I'd rather use something practical, like Python. Haskell was more mind-expanding than Ocaml, and so was better for the task at hand.

Re: Ask Hackers: Opinions on OCaml?

#7

i used ocaml very briefly so my opinion should be taken with a huge grain of salt. The language is nice. The type system is mostly pretty cool .. there were some programs that were "correct if it compiled". But sometimes the type system sometimes comes in the way .. I hear (but dont know firsthand) that Haskell's type classes alleviate some of the pain.

Haskell's type system will bring a lot of pain first. And then one day it'll click (like macros) and then it makes everything simple.

Re: Ask Hackers: Opinions on OCaml?

#8
I wrote a few projects in OCaml, and it's a great language if it suits the problem, but it can get in the way otherwise.

What it's great for is anything that involves the manipulation of lists or trees - one of my projects in OCaml was a simple computer algebra system, and OCaml was great for that. I had previously written a super-simple interpreter for a made-up programming language in Java, and in comparison OCaml is way more expressive for that type of project. I also wrote a fractal renderer in OCaml and found the expresivity helpful, although the library support was not great so I ended up writing my own bitmap library. It's also nice to be able to break out of the purely-functional paradigm, because there are times when a problem is better suited for imperative programming.

Another project I did in OCaml was a web proxy, and it turned out to not be a great idea. The libraries were confusing and in the end I wished I used python.

So it really comes down to the project. OCaml is very cool conceptually, and it is great for certain tasks, and not so great for others. (For what it's worth, I've only been using OCaml intermittently for about a year, so I am no expert.)

Re: Ask Hackers: Opinions on OCaml?

#9
post #2

I've used it. I think OCaml would be a big win if you have your software designed all up front, and need to verify that it works correctly, e.g., avionics software. Unfortunately, avionics software development seems to be moving toward C/C++...

It blows my mind that in 2008 companies are moving toward C++.

Re: Ask Hackers: Opinions on OCaml?

#10

Looked into it in college. I liked it a lot - it's fast, clean, safe, and has some cool features. Also was easier to learn than Haskell. I left it behind because it was easier to learn than Haskell. I use these languages (Ocaml, Haskell, Erlang, Scheme) because they're mind-expanding. For practical programs, I'd rather use something practical, like Python. Haskell was more mind-expanding than Ocaml, and so was better…

Interesting, I had thought OCaml and Haskell were pretty equivalent in regards to functional programming. OCaml's plus is the ability to break out of the functional mindset when you really need it, mainly for speed (can beat c++ when used properly): http://www.cs.ubc.ca/~murphyk/Software/Ocaml/why_ocaml.html

I think that is cool, because in my mind functional and imperative programming each have their distinct niche's of effectiveness. However, I have zero significant projects under my belt in any functional language, so I'm not necessarily one to talk.

Update

This is a counter (on slashdot w/ discussion) to the speed claim: http://developers.slashdot.org/article.pl?sid=05/03/14/22582...

Post reply on HN