title: Using Haskell for sizable real-time systems: how (if?)?
body: <p>I've been curious to understand if it is possible to apply the power of Haskell to embedded realtime world, and in googling have found the <a href="http://hackage.haskell.org/package/atom" rel="noreferrer">Atom</a> package. I'd assume that in the complex case the code might have all the classical C bugs - crashes, memory corruptions, etc, which would then need to be traced to the original Haskell code that
  caused them. So, this is the first part of the question: "If you had the experience with Atom, how did you deal with the task of debugging the low-level bugs in compiled C code and fixing them in Haskell original code ?"</p>
  
  <p>I searched for some more examples for Atom, <a href="http://archhaskell.wordpress.com/2009/08/01/atom-a-domain-specific-language-for-hard-realtime-applications/" rel="noreferrer">this blog post</a> mentions the resulting C code 22KLOC (and obviously no code:), the <a href="http://hackage.haskell.org/packages/archive/atom/0.1.0/doc/html/src/Language-Atom-Example.html#example" rel="noreferrer">included example</a> is a toy. <a href="http://leepike.wordpress.com/source-code/atomfibhs/" rel="noreferrer">This</a> and <a href="http://blog.sw17ch.com/wordpress/?p=111" rel="noreferrer">this</a> references have a bit more practical code, but this is where this ends. And the reason I put "sizable" in the subject is, I'm most interested if you might share your experiences of working with the generated C code in the range of 300KLOC+. </p>
  
  <p>As I am a Haskell newbie, obviously there may be other ways that I did not find due to my unknown unknowns, so any other pointers for self-education in this area would be greatly appreciated - and this is the second part of the question - "what would be some other practical methods (if) of doing real-time development in Haskell?". If the multicore is also in the picture, that's an extra plus :-) </p>
  
  <p>(About usage of Haskell itself for this purpose: from what I read in <a href="http://mikeburrell.wordpress.com/2007/02/01/real-time-haskell/" rel="noreferrer">this blog post</a>, the garbage collection and laziness in Haskell makes it rather nondeterministic scheduling-wise, but maybe in two years something has changed. <a href="https://stackoverflow.com/questions/1113226/real-world-haskell-programming">Real world Haskell programming</a> question on SO was the closest that I could find to this topic)</p>
  
  <p><strong>Note:</strong> "real-time" above is would be closer to "hard realtime" - I'm curious if it is possible to ensure that the pause time when the main task is not executing is under 0.5ms.</p>