Professional Documents
Culture Documents
• 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
2008 Galois, Inc. All rights reserved.
Recent experience
First demo of a big systems project
• Six engineers
• 50k lines of code, in 5 components,
developed over a number of months
• Integrated, tested, demo'd in only a week,
two months ahead of schedule, 2 rungs
above performance spec.
• 1 space leak, spotted and fixed on first
day of testing
• 2 bugs found (typos from spec)
2008 Galois, Inc. All rights reserved.
Purity is fundamental
• 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
2008 Galois, Inc. All rights reserved.
7. Documentation
Generating supporting artifacts
• -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
2008 Galois, Inc. All rights reserved.
11. Things that we still need
More support for large scale
programming
• Enforcing conventions across the code
• Data representation precision (emerging)
• A serious refactoring tool
• Vetted and audited libraries by experts
(Haskell Platform)
• Idioms for mapping design onto
types/functions/classes/monads
• Better capture your 100 module design!
2008 Galois, Inc. All rights reserved.