deeqSeq proposal

Fergus Henderson fjh-mailbox-18 at galois.com
Thu Apr 6 12:48:55 EDT 2006


On 05-Apr-2006, Ben Rudiak-Gould <Benjamin.Rudiak-Gould at cl.cam.ac.uk> wrote:
> Andy Gill wrote:
> >- [various reasons for deepSeq]
> You left out the one that most interests me: ensuring that there are no 
> exceptions hiding inside a data structure.

Yes, that's important for fault isolation... see below.

On 03-Apr-2006, Andy Gill <andy at galois.com> wrote:
>
> - Fergus Henderson used deeqSeq in our Cryptol to FPGA compiler, between
> each pass, to make sure that we could assess which pass was taking
> what time.

Actually that wasn't the only reason why we needed deepSeq.

The other reason, at least as important, was fault isolation.  Like most
compilers, the Cryptol to FPGA compiler consists of a number of of
separate compilation phases.  When a problem in our compiler such as
an exception, heap or stack exhaustion, or an infinite loop occurs,
it is very helpful to be able to know in which phase that error occurred.

With lazy evaluation, this is tricky, since the execution of
all the different phases will be interleaved.  Any debugging
messages produced by "trace" from the different stages also
get interleaved.

The Cryptol to FPGA compiler will (in verbose mode) print out a message
when it starts each compilation stage.  We use deepSeq to ensure that each
stage has been fully evaluated before proceeding on to the next stage.
This allows us to isolate faults to a particular compilation stage.

I also used hyperSeq in previous Haskell programs before I joined Galois.
I've found the need for this to be quite common...

-- 
Fergus J. Henderson                 |  "I have always known that the pursuit
Galois Connections, Inc.            |  of excellence is a lethal habit"
Phone: +1 503 626 6616              |     -- the last words of T. S. Garp.


More information about the Haskell-prime mailing list