Live data from Hacker News

OCaml for the Masses

queue.acm.org

1–10 of 29 posts

Re: OCaml for the Masses

#3
Seems like financial/quant computing would be a natural fit. The author mentions ocaml being well suited for general programming needs - Anyone using ocaml (or haskell/f#/etc.) for real production code?

Edit: should have mentioned this earlier for an example - xmonad is written in haskell

Re: OCaml for the Masses

#4
To someone who has only just looked at Haskell (and not gotten very far) the syntax looks very similar. Can anyone speak to the differences between the two languages?

Re: OCaml for the Masses

#5
post #4

To someone who has only just looked at Haskell (and not gotten very far) the syntax looks very similar. Can anyone speak to the differences between the two languages?

http://matt.might.net/articles/best-programming-languages/

This write-up describes the basics of ocaml and haskell and some of their individual strengths. (along with scala and scheme)

Re: OCaml for the Masses

#6
post #3

Seems like financial/quant computing would be a natural fit. The author mentions ocaml being well suited for general programming needs - Anyone using ocaml (or haskell/f#/etc.) for real production code? Edit: should have mentioned this earlier for an example - xmonad is written in haskell

Several investment banks are using these languages in production (BarCap (F#) and Standard Chartered (Haskell) are the names that come immediately to mind).

And of course Minsky's employer, Jane Street Capital, writes everything in OCaml.

There are plenty of commercial users outside the financial sector too but those users tend to be smaller companies.

Re: OCaml for the Masses

#7
post #2

For anyone who wants to try out the language, here's an OCaml tutorial with an in-browser interpreter: http://try.ocamlpro.com/

Hmm, only 2 lessons and nothing more than I figured out before I even started them. Hopefully they'll expand in the future.

Re: OCaml for the Masses

#8
post #4

To someone who has only just looked at Haskell (and not gotten very far) the syntax looks very similar. Can anyone speak to the differences between the two languages?

The type systems is one major difference. OCaml as the name suggests supports objects. Haskell's type system is more expressive. I believe OCaml's type inference system is fully decidable Haskell's isn't. The evaluation models are different Haskell is lazy default, Ocaml is eager default. Ocaml doesn't support multiple native threads(green threads only.) Ocaml isn't pure.

Re: OCaml for the Masses

#9
post #4

To someone who has only just looked at Haskell (and not gotten very far) the syntax looks very similar. Can anyone speak to the differences between the two languages?

OCaml is strict and impure, Haskell lazy and pure. Syntactically they're pretty different, but since they both make heavy use of the H-M type system you see pretty similar semantic operations across the board. Probably the first thing that sets them apart is that IO is a lot more direct in OCaml, a direct implication of strictness and impurity.

Extensions to the type system are really different, OCaml's is more flexible and specific, but Haskell's is very convenient, but by the time that becomes an issue you'll probably know a lot more of how the languages differ.

Re: OCaml for the Masses

#10
"Yet functional languages never really made it to the mainstream"

JavaScript development these days is getting pretty darn close to what I would consider 'mainstream' functional programming.

Heavy use of both first class and lambda functions, and closures have been standard practices for years now. And thanks to libraries like Underscore.js partial application and the use higher order functions like map/filter/etc are also becoming very common place.

I'll absolutely agree that what we see is not 'pure' functional programming but neither is a good deal of real world Common Lisp.

Anyone who has done a lot of programming in Lisp or Haskell has probably bemoaned the fact that many people are quick to dismiss so many great and useful tools these langauges provide. But I definitely think we're starting to see a trend where the most genuinely useful features of fp are becoming mainstream.

Post reply on HN