Experience Report:
Haskell in the Real World
Curt J. Sampson
Starling Software, K.K.
Tokyo, Japan
<cjs@starling-software.com>
This presentation will be in a sort of inverse order. I'll present a few highlights, and
The Project
Automated options trading application.
High level algorithms such as:
Pricing calculations
Margin cacluations and risk models
Lots of arithmetic!
Low-level algorithms such as:
Parsing real-time market data feeds
Generating and reporting from transaction logs
Lots of shovelling bits around!
Speed is important: tens of milliseconds make a difference.
The Implementation
Everything written in Haskell, excepting a few Ruby and shell scripts.
Compiled with GHC 6.8 (last year) and 6.10 (now).
Trader, simulators, database tools all run under Unix.
Excel DDE server runs under Windows.
Even C-like code to interface with Windows C libraries is written in Haskell (using FFI).
May need one line of C to set default GHC RTS options.
- Most people still seem to use C/C++ for the low-level stuff.
Conclusions: Haskell
Difficult to learn, but far from impossible; good support available.
Lazy evaluation in particular can make for some difficult performance problems at first.
Extremely powerful language, with excellent new control structures.
Type system very helpful; reduced testing significantly.
Very concise, thus code is cheap to maintain.
Foreign Function Internface (FFI) design is far beyond any other system I've seen.
Conclusions: GHC
For commercial development, it works pretty well.
Compiler appears to be as reliable as gcc, and it can generate quite fast code.
Runtime (GC, threading, etc.) seems as good as or better than JVM.
Works well with all the usual Unix tools
Very portable between Unix and Windows, and easy access to native APIs on both.
Could use better profiling tools, particularly for memory usage and performance of multi-processing programs. (GHC 6.12, ThreadScope may be enough.)
Why this paper?
Get this result into the literature, so that Haskell enthusiasts can point to successful commercial projects.
Provide some guidance and hints for others contemplating Haskell for major projects.
Help teachers show relevance of Haskell, and perhaps understand more about how it's used outside of education.
Let GHC developers know what commercial developers are looking for, what works well, and what doesn't.
Why this paper?
Get this result into the literature, so that Haskell enthusiasts can point to successful commercial projects.
Provide some guidance and hints for others contemplating Haskell for major projects.
Help teachers show relevance of Haskell, and perhaps understand more about how it's used outside of education.
Let GHC developers know what commercial developers are looking for, what works well, and what doesn't.
Oh yeah. We're hiring in a few months.