Engineering Large Projects in A Functional Language
Engineering Large Projects in A Functional Language
in a Functional Language
Lessons from a Decade of Haskell at Galois
Don Stewart | 2010-07-10 | DevNation PDX
This talk made possible by...
Aaron Tomb Joel Stanley
Adam Wick John Launchbury
Jonathan Daugherty
Andy Gill
Josh Hoyt
David Burke
Laura McKinney
Dylan McNamee
Ledah Casburn
Eric Mertens
Lee Pike
Iavor Diatchki
Levent Erkok
Isaac Potoczny-Jones
Louis Testa
Jef Bell
Magnus Carlsson
Peter White
Matt Sottile
Trevor Elliott
Paul Heinlein
Phil Weaver Rogan Creswick
Jason Dagit Sally Browning
Jeff Lewis Sigbjorn Finne
Joe Hurd Thomas Nordin
Brett Letner
© 2010 Galois, Inc. All rights reserved. … and many others
What does Galois do?
Simple things:
• Correct arguments to a function
• Function f does not touch the disk
• No null pointers
• Mixing up similar concepts:
– Virtual / physical addresses
Serious things:
• Information flow policies
• Correct component wiring and integration
forkIO rocks
• Cheap, very fast, precise threads
MVars rock
STM rocks (safely composable locks!)
Testing
• QuickCheck!!!
Heap profiling
• “By type” profiling of the heap
GHC -fhpc
• Great for finding exceptions
• Understanding what is executing
+RTS -stderr
• Explain what GC, threads, memory is up to
-Wall police
Consistent layout
No tabs
Import qualified Control.Exception
{-# LANGUAGE … #-}
Map exceptions into Either / Maybe
deriving Show
Line/column for errors if you must throw
No global mutable state
Put type sigs in “when you're done” with the design
Use GHCi for rapid experimentation
Cabal by default.
Libraries by default