Live data from Hacker News

OCaml for the Masses

queue.acm.org

21–29 of 29 posts

Re: OCaml for the Masses

#21
post #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.

It strangely skips to lesson 20, where you get a taste of some esoteric features and syntactic conveniences from the latest release.

Re: OCaml for the Masses

#22

Earlier quoted context omitted.

The compiler for haXe ( http://www.haxe.org/ ) is written in OCaml. That's actually how I ran across OCaml to begin with.

Wow, I had no idea haxe was still around. I looked at using it about 4-5 years ago and dismissed it as not ready for prime time, but that looks like a reasonably active community.

If you're interested in haxe make sure to check out haxenme[1] as well. I haven't worked with it yet, but plan to do so.

[1] http://www.haxenme.org/

Re: OCaml for the Masses

#23

Earlier quoted context omitted.

The compiler for haXe ( http://www.haxe.org/ ) is written in OCaml. That's actually how I ran across OCaml to begin with.

Wow, I had no idea haxe was still around. I looked at using it about 4-5 years ago and dismissed it as not ready for prime time, but that looks like a reasonably active community.

Honestly I'm quite surprised that it hasn't taken off more - the language itself is very nice and well-designed, and the way it handles multiple platforms is surprisingly elegant. The only real complaint I have with it is that the documentation is a bit disjointed.

Re: OCaml for the Masses

#24
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.

Whenever I see OCaml brought up, it is nearly always by Minsky. Is it that very few people use it in general? That it is particularly well suited to the problems a private hedge fund faces (oxymoron I know, but I don't know how else to describe Jane Street)? Or that Minsky just happens to be vocal in the internet circles I tend to gravitate toward?

Re: OCaml for the Masses

#25
post #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 flexi…

> Syntactically they're pretty different,

Did you want to say that they are pretty similar? Or semantically different?

Re: OCaml for the Masses

#26
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.

> I believe OCaml's type inference system is fully decidable Haskell's isn't.

That depends on the extensions you are using.

The biggest difference between the typesystems in practice seems to be the ubiquitous use of type classes in Haskell. OCaml's modules can do the same as type classes, but they require annotations and aren't used as pervasively.

Re: OCaml for the Masses

#27
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

Citrix uses Haskell and OCaml in production code. It's predominately open-source, too.

Re: OCaml for the Masses

#28

Earlier quoted context omitted.

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.

Whenever I see OCaml brought up, it is nearly always by Minsky. Is it that very few people use it in general? That it is particularly well suited to the problems a private hedge fund faces (oxymoron I know, but I don't know how else to describe Jane Street)? Or that Minsky just happens to be vocal in the internet circles I tend to gravitate toward?

Jane Street is a `prop shop' in the lingo of the industry.

You are right, OCaml doesn't see too much use outside of Jane Street, Citrix and a few others. I think the academics mostly left it in favour of Haskell. Also the owner of the OCaml project didn't embrace community development early on. It's more like a cathedral than a bazaar. They are signs showing to change, but it's probably already too late for mainstream popularity.

Re: OCaml for the Masses

#29
post #25
post #9

Earlier quoted context omitted.

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 flexi…

> Syntactically they're pretty different, Did you want to say that they are pretty similar? Or semantically different?

Syntax is different, semantics are informed by the type system so programming in one after being familiar with the other is pretty concept-friendly.
Post reply on HN