tsuruCapital :: Lambda -> Dollar - UGent

3 downloads 366 Views 2MB Size Report
Dec 12, 2012 - Why Haskell? Some really good libraries ... 6 byte issue code. 5 * 12 byte best prices ... Example: FRP.
tsuruCapital :: Lambda -> Dollar FLP 2012 Jasper Van der Jeugt December 12, 2012

Hello! My name is Jasper Student at UGent I write Haskell Tsuru Capital @jaspervdj jaspervdj.be

Overview About Tsuru Capital Why Haskell? Example: parsers Example: FRP

About Tsuru Capital

1. Haskell

About Tsuru Capital

2. Small team

About Tsuru Capital

3. Casual atmosphere

About Tsuru Capital

4. Tokyo (and Singapore)

About Tsuru Capital

5. Finance

Overview About Tsuru Capital Why Haskell? Example: parsers Example: FRP

Why Haskell?

Why not Haskell? Too hard? Too slow? Too annoying?

“I don’t know how we would possibly get anything done without Haskell” — Alex

Why Haskell? First commit in 2008 Trader & tools: ±72k lines of Haskell Still some Bash scripts, some Ruby (Not counting external libraries)

Why Haskell?

Types newtype Price = P Int

Why Haskell? Types AveragePrice, FairPrice, KeyPrice, LikelyPrice, Price, StrikePrice, SynPrice...

Why Haskell?

Types Change the type of one function, break the entire build (yay!)

Why Haskell?

Haskell is fast

Why Haskell?

 Haskell is  fast Haskell can be fast

Why Haskell? Haskell can be fast Performance is always measured (even in production) Daily reports of loop times

Why Haskell?

Why Haskell? Some really good libraries aeson, lens, elerea, text, binary, async, statistics, diagrams, criterion... (Some bad ones as well)

Overview About Tsuru Capital Why Haskell? Example: parsers Example: FRP

Example: parsers

We write a lot of parsers at Tsuru

Example: parsers Parsers in Haskell Happy Parsec Attoparsec ...

Example: parsers Typical proprietary packet 1 * 1 * 1 * 2 * 5 * ...

11 11 10 6 12

byte byte byte byte byte

message no transaction code market opgroup code issue code best prices

Example: parsers

Typically ASCII-only packets KSEBID_0123011101100105...

Example: parsers Using e.g. Parsec packet :: Parser packet = do messageNo UIx Widget