www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - (OCa)ML for Trading [OT]

This post is OT, yet I think knowing why and how other languages are used is
not bad for D developers and users.

The Jane Street programmers write software for trading. Originally they have
used Excel and VisualBasic, then have tried C# and failed (too verbose and
complex, they say). They have found OCaML a good language for their purposes.
They don't need a system language, so maybe D is not fit for them.

They need a language that's safe (because they are managing large amounts of
money), that allows to write very fast programs (because today trading software
is meant to work very quickly. OCaML programs are usually no more than 1.5-3
times slower than C ones), and such safety needs to be kept despite very
frequent changes in lot of code, as commercial situations keep shifting all the
time.

OCaML has many disadvantages they recognize and explain, but they have
appreciated OCaML because of:
- Its readability and its terseness and because it allows to avoid duplicate
code.
- Immutability on default most of the times (but there is some mutability too
when necessary).
- Pattern Matching, because many programs of their program perform case
analysis. For them an important feature of OCaML pattern matching is that it
forces at compile-time the programmer to handle all possible cases. This is
very useful to keep the code correct as other parts of the program change
quickly in time.
- Labeled Arguments, because they make the code safer and more readable (this
feature is near the top of my desired enhancements for future D).
- Polymorphic Variants
- Modularity
- Phantom Types (http://en.wikipedia.org/wiki/Generalized_algebraic_data_type ).

But above many other things they appreciate a lot the strict type system of
OCaML that often allows to make illegal states unrepresentable (this is
somewhat related to the idea of typestates). The video on Vimeo shows this too.

Videos and articles:
http://vimeo.com/14313378
http://www.janestcapital.com/technology/articles.php
http://www.janestreetcapital.com/minsky_weeks-jfp_18.pdf
http://www.janestcapital.com/yaron_minsky-cufp_2006.pdf

Bye,
bearophile
Jan 26 2011