<br><br><div class="gmail_quote">On Thu, Aug 6, 2009 at 1:39 PM, Henning Thielemann <span dir="ltr">&lt;<a href="mailto:lemming@henning-thielemann.de">lemming@henning-thielemann.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Today a student has shown me a program that consists of a large &#39;do&#39; block for the list monad. The program looks like<br>
<br>
   do x1 &lt;- [0..3]<br>
      x2 &lt;- [0..2]<br>
      ...<br>
      x600 &lt;- [0..5]<br>
      guard (x1+x2+2*x3 &gt;= 0)<br>
      ...<br>
      return (x1,x2,....,x600)<br>
<br>
It was actually generated by another program. The results were:<br>
<br>
 GHC-6.4 was not able to compile that program at all, because it stopped because of memory exhaustion.</blockquote><div><br>Did you try playing with optimization options?  I think someone just mentioned that compiling large amounts of static data in GHC is problematic and recommended something like -O0 to prevent GHC from analyzing it.  Of course, I wouldn&#39;t recommend having unoptimized code, but I&#39;m curious how that changes the results here.<br>
<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
 GHC-6.8.2 finished compilation after two minutes but the program aborted quickly because of a corrupt thunk identifier.</blockquote><div><br>Oh that&#39;s icky.<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
 GHC-6.10 not yet tested.<br>
 Hugs-2006 executed the program without complaining and showed the first result after a few seconds: (0,0,0,0,0,...,0).<br>
<br>
Eventually the program must run on a Linux cluster with a not up-to-date Linux kernel, that is, I suspect newer GHC versions cannot be used due to the &#39;timer_create&#39; problem. (At least, the &#39;cabal&#39; executable that I generated with a GHC-6.8.2 had this problem when running on the cluster which reminded me on the problems with GHC-6.8 itself running on older Linux kernels.)</blockquote>
<div><br>I just googled this and found this:<br><a href="http://www.haskell.org/pipermail/glasgow-haskell-users/2008-March/014498.html">http://www.haskell.org/pipermail/glasgow-haskell-users/2008-March/014498.html</a><br>
That was linked from this discussion:<br><a href="http://www.nabble.com/ghc-6.8.2-and-timer_create-error-td16160635.html">http://www.nabble.com/ghc-6.8.2-and-timer_create-error-td16160635.html</a><br><br>The second link seems to indicate that it&#39;s not a problem of antiquity but instead one related to what configure finds when building GHC for that system.  In other words, it should be possible to make a version of GHC locally that doesn&#39;t use timer_create and then your student should be good to go. <br>
<br>Hope that helps,<br>Jason<br></div></div>