5 ms·
OCaml for the Masses
- iskander 15y agoFor anyone who wants to try out the language, here's an OCaml tutorial with an in-browser interpreter: http://try.ocamlpro.com/ http://try.ocamlpro.com/
- mbowcock 15y agoSeems 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
- batterseapower 15y agoSeveral 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.
- fhars 15y agoLike that small software vendor from seattle http://research.microsoft.com/en-us/um/redmond/projects/z3/ml/z3.html http://research.microsoft.com/en-us/um/redmond/projects/z3/m... http://research.microsoft.com/en-us/projects/slam/default.aspx http://research.microsoft.com/en-us/projects/slam/default.as...
- clavalle 15y agoWhenever 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?
- eru 15y agoJane 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.
- LeafStorm 15y agoThe compiler for haXe (http://www.haxe.org/ http://www.haxe.org/) is written in OCaml. That's actually how I ran across OCaml to begin with.
- ArbitraryLimits 15y agoWow, 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.
- boofar 15y agoIf 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/ http://www.haxenme.org/
- LeafStorm 15y agoHonestly 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.
- dons 15y agohttp://cufp.org/ http://cufp.org/ is held every year, and has many interesting stories. http://www.haskell.org/haskellwiki/Haskell_in_industry http://www.haskell.org/haskellwiki/Haskell_in_industry has experience reports for Haskell. Galois and Standard Chartered both have large Haskell teams, for example (I've worked for both).
- smosher 15y agoJohn Carmack mentioned OCaml and Haskell at the last QuakeCon (on the topics of game scripting and static analysis), citing performance and hiring issues: https://www.youtube.com/watch?v=4zgYG-_ha28 https://www.youtube.com/watch?v=4zgYG-_ha28 (1:10ish) I'm not sure about the performance issue. If it stays within a reasonable (low single-digit) factor I think the hit is worth the quality guarantees you can get out of it. The hiring/education issue is probably the #1 reason so few attempts are made in this direction.
- eru 15y agoCitrix uses Haskell and OCaml in production code. It's predominately open-source, too.
- rauljara 15y agoTo 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?
- mbowcock 15y agohttp://matt.might.net/articles/best-programming-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)
- stonemetal 15y agoThe 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.
- eru 15y ago> 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.
- tel 15y agoOCaml 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.
- Homunculiheaded 15y ago"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.
- andolanra 15y agoThere is a great deal of what functional languages can do that isn't (yet) being absorbed—especially from the statically typed areas, where you can statically verify things like the length of lists using GADTs or other impressively strong compile-time guarantees—but the bits that have been absorbed are useful enough and general enough that those elements of functional languages are already conferring huge benefits to 'mainstream' programming. I suspect that, by the very nature of 'mainstream' programming, it tends to absorb some but not all features of other paradigms, leaving things that are strongly esoteric aside but still grabbing useful features. This happened before with object-oriented programming, where the Java/C++ world incorporated somewhat watered-down elements of Smalltalk. We still don't see full-blown message-passing OOP in most mainstream languages, but we see enough useful features of OOP to make a difference. I don't know, in general, that they're the "most useful" if utility is defined as conferring the ability to write better programs more quickly, more understandably, &c. But they are "most useful" in the sense that they confer such benefits with a minimum learning curve and with little deviation from the already understood mainstream programming paradigm. For example, monads are an incredibly useful feature, but the (perceived) barriers to understanding are high enough that no mainstream language will feature them as centrally as Haskell does. I don't mean this as a sleight against anyone, at all—merely as a description. There are a lot of useful things which are outside the purview of the mainstream, and there's no reason to expect that nonetheless useful features of fp will necessarily make it into the mainstream. (And there are certainly cases where functional programming as a whole, and not just cribbed features, is desirable and advantageous, as in Jane Street's case, so I do hope that more non-academics come to see it as a valid paradigm for certain tasks.)
- postfuturist 15y agoseems down, google cache : http://webcache.googleusercontent.com/search?q=cache:7Ikgs4EiZ4UJ:queue.acm.org/detail.cfm%3Fid%3D2038036+&cd=1&hl=en&ct=clnk&gl=us http://webcache.googleusercontent.com/search?q=cache:7Ikgs4E...