Speaking to a number of quants / hedgies, I came to the conclusion that a large number of them seem to be using either a homebrew language or OCaml for many tasks. What many of them couldn't answer was why.
I can certainly understand why they wouldnt want to use C++ for the most part, but why is OCaml superior for these uses compared to other scripting languages, say Python, Ruby etc?
It adopted OCaml as its main programming language early on because the language's functional programming style and clear expressiveness made it possible for code reviews to be performed by traders who were not programmers, to verify that high-performance code would do what it was intended to do.
Java is the top-ranked programming language in finance, according to HackerRank, for reasons that mirror its general cross-industry popularity. The language has a friendly learning curve, can handle significant amounts of data, and boasts rigid security features.
According to The great computer language shootout, (see also the newer Computer language shootout benchmarks) Ocaml is the second fastest language - slower than C, but faster than C++.
Try reading Caml trading - experiences with functional programming on Wall Street by Yaron Minsky and Stephen Weeks (apologies, while this article used to be hosted for free at Jane Capital, it is no longer there, so I leave the ACM link for reference). They go into great detail about what they feel are the advantages and disadvantages of OCaml, though they for the most part take it as a given that it is better than most other options they considered (i.e. not a lot of direct comparisons with C++, Python, what have you).
The authors work at Jane Street Capital which has invested heavily in OCaml code.
Update: See also the thread What programming language(s) is algorithmic trading software written in?. One of the comments mentions a presentation Yaron Minsky gave at CMU on Jane Street Capital's use of Caml. About an hour long, and very interesting.
Update Two: Yaron has written another overview, this time for ACM Queue, called OCaml for the Masses.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With