<story><title>Haskell in Production: Standard Chartered</title><url>https://serokell.io/blog/haskell-in-production-standard-chartered</url></story><parent_chain><item><author>kerkeslager</author><text>I&amp;#x27;ve talked to a lot of people using Haskell in production over the years, and one of the things I&amp;#x27;ve consistently noticed is a disconnect between the Haskell features that are often touted, and the Haskell features that people use in production.&lt;p&gt;This isn&amp;#x27;t always a quiet omission, like &amp;quot;we didn&amp;#x27;t end up using this&amp;quot; either. The best example is that a lot of people end up doing some significant work to disable lazy evaluation. Simon Peyton Jones is reported to have said that lazy evaluation has been kept &amp;quot;to keep us honest about side effects&amp;quot;, i.e., that size effects become immediately painful with pervasive lazy evaluation. But in a production system, functional purity (no side-effects) is a means to an end, and lazy evaluation comes at a pretty extreme performance cost. Not everyone disables lazy evaluation in production Haskell, because not everyone thinks they need to for performance, but I&amp;#x27;ve definitely heard about it enough times that it seems like a relevant pattern.&lt;p&gt;Production users of Haskell do seem to be happy about types, years into projects, so I&amp;#x27;d take away that types are a benefit, but I do wonder if one might get those same benefits in another language without the problems which seem to crop up with Haskell, such as laziness causing performance issues, monadic complexity, and difficulty hiring.</text></item></parent_chain><comment><author>thesz</author><text>If you disable lazy evaluation, you would not be able to write arbitrary &amp;quot;where&amp;quot; sections, with definitions ordered as you want them, including tying-the-knot definitions, which are not exceptionally rare.&lt;p&gt;So no one disables lazy evaluation.&lt;p&gt;It is strict evaluation that is selectively enabled.&lt;p&gt;I also have to say that focusing on the types in the compiler development was the right thing, but what was not right is not focusing on the automatic analysis and removal of thunk creation for lazy evaluation. There is a project now to implement GRIN (graph reductin intermediate notation) [1] which supports such analysis and GRIN is early 90-th.&lt;p&gt;[1] &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;grin-compiler.github.io&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;grin-compiler.github.io&amp;#x2F;&lt;/a&gt;&lt;p&gt;GRIN also automatically gives you many benefits of supercompilation.&lt;p&gt;We could have a much better Haskell code now if ghc decided to support several backends back then, not only STG&amp;#x2F;C--.</text></comment>
<story><title>Haskell in Production: Standard Chartered</title><url>https://serokell.io/blog/haskell-in-production-standard-chartered</url></story><parent_chain><item><author>kerkeslager</author><text>I&amp;#x27;ve talked to a lot of people using Haskell in production over the years, and one of the things I&amp;#x27;ve consistently noticed is a disconnect between the Haskell features that are often touted, and the Haskell features that people use in production.&lt;p&gt;This isn&amp;#x27;t always a quiet omission, like &amp;quot;we didn&amp;#x27;t end up using this&amp;quot; either. The best example is that a lot of people end up doing some significant work to disable lazy evaluation. Simon Peyton Jones is reported to have said that lazy evaluation has been kept &amp;quot;to keep us honest about side effects&amp;quot;, i.e., that size effects become immediately painful with pervasive lazy evaluation. But in a production system, functional purity (no side-effects) is a means to an end, and lazy evaluation comes at a pretty extreme performance cost. Not everyone disables lazy evaluation in production Haskell, because not everyone thinks they need to for performance, but I&amp;#x27;ve definitely heard about it enough times that it seems like a relevant pattern.&lt;p&gt;Production users of Haskell do seem to be happy about types, years into projects, so I&amp;#x27;d take away that types are a benefit, but I do wonder if one might get those same benefits in another language without the problems which seem to crop up with Haskell, such as laziness causing performance issues, monadic complexity, and difficulty hiring.</text></item></parent_chain><comment><author>tome</author><text>A few minor corrections&lt;p&gt;&amp;gt; Simon Peyton Jones is reported to have said that lazy evaluation has been kept &amp;quot;to keep us honest about side effects&amp;quot;&lt;p&gt;Rather, one of the main benefits of laziness was to force purity and thereby to instigate the development of typed effects.  By contrast, the reason that laziness has been &amp;quot;kept&amp;quot; is simply that switching to strictness now would break (almost) all Haskell programs!&lt;p&gt;&amp;gt; lazy evaluation comes at a pretty extreme performance cost&lt;p&gt;Not really.  Haskell&amp;#x27;s implementation of laziness is very high performance and the compiler can easily determine when creating thunks is not necessary.  The reason that lazy evaluation leads to performance problems is that programmers don&amp;#x27;t know how to use it correctly.  Whether that&amp;#x27;s the fault of the language or the programmers is up for debate.</text></comment>