3 ms·
Not a user of Haskell but interested in it. What makes my spider-sense tingle in Haskell is lazyness. It's all cool until you unexpectedly hit that lazy unroll
by kaoD 12y ago
Not a user of Haskell but interested in it.
What makes my spider-sense tingle in Haskell is lazyness. It's all cool until you unexpectedly hit that lazy unroll (not sure what the correct term is) in a time-critical system.
Are there ways to control lazyness in Haskell, just like there are ways to control mutable state?
- kazagistar 12y agoOf course; careful control of evaluation strategies is one of the methods by which parallelism is accomplished. At the simpler level, parameters and items in records can be strictly evaluated. However, once you get used to it, you start to find that strict evaluation is rarely useful.
- wyager 12y agoLaziness is just the default (and most likely to terminate) evaluation strategy. You can use a number of techniques (the simplest being Bang Patterns) to enforce non-lazy evaluation strategies (including strict evaluation, parallel evaluation, sequential evaluation, etc.). However, there are very few activities where Haskell's laziness will cause disruptive timing variations. Any language that you might use instead of Haskell is probably heavily heap-oriented, and likely garbage collected, which means that you're already dealing with unpredictable timing variance.
- dragonwriter 12y ago> Are there ways to control lazyness in Haskell Yes. http://www.haskell.org/haskellwiki/Performance/Strictness http://www.haskell.org/haskellwiki/Performance/Strictness