[Haskell-cafe] Real-time garbage collection for Haskell
Thomas Schilling
nominolo at googlemail.com
Mon Mar 1 14:37:06 EST 2010
On 1 March 2010 16:27, Job Vranish <job.vranish at gmail.com> wrote:
> My current area of work is on realtime embedded software programming for
> avionics systems. We do most of our coding in Ada but I've been dreaming of
> using haskell instaed.
Do you really think this is realistic? Garbage collector aside,
Haskell's execution model is very difficult to predict, which I would
suspect is crucial for even soft real-time systems. The whole concept
of lazy evaluation seems to run counter to the idea of real-time
systems. Lazy evaluation essentially says "do as little as possible
*now*" at the expense of having to do it all later. For a real-time
system you want almost the opposite; you want to make sure that you
complete all the required work in the current time slice.
A possible workaround would be to sprinkle lots of 'rnf's around your
code to make sure you don't build up a thunk or two that will delay
you later. And if you do this, aren't you essentially programming in
a strict functional language (like SML or O'Caml)? By careful
profiling you and auditing you can probably rule out most of the
potential bad cases, so it can be acceptable for a soft real-time
system (Galois did something like this, I believe). But for avionics
systems you probably want to more assurances than that, don't you?
--
Push the envelope. Watch it bend.
More information about the Haskell-Cafe
mailing list