News for hackers. Stuff that matters.
Re:Introducing Haskell to a Company by iammiles on Tuesday October 02, 2018 @07:36PM (#18126586)
My thoughts exactly. I'm curious what compelled the author to choose Haskell over F#.
Re:Introducing Haskell to a Company by toastal on Tuesday October 02, 2018 @11:26PM (#18127434)
If I recall, F# doesn't require managed IO which just opens up a can of debugging worms to where you have no guarantees of where side effects and impurity are happening.
Re:Introducing Haskell to a Company by vmchale on Tuesday October 02, 2018 @09:32PM (#18127033)
I'm not familiar with F# but from what I understand it lacks support for laziness, unlike GHC.
Re:Introducing Haskell to a Company by Barrin92 on Tuesday October 02, 2018 @10:33PM (#18127245)
I think this is Haskell's biggest disadvantage in industrial sized applications because it significantly complicates debugging and performance reasoning.

Laziness is, in my opinion, the wrong default.

Re:Introducing Haskell to a Company by vmchale on Wednesday October 03, 2018 @04:25PM (#18134510)
> complicates debugging and performance reasoning

Lots of people say this, very few understand what it actually means and how to do the analyses.

> Laziness is, in my opinion, the wrong default.

Unfortunately, GHC is still the only compiler with first-class support for laziness as well as strictness. And you need both if you want to be able to do immutable functional programming.

But in the grand scheme of things it doesn't really matter if you know what you're doing when you use data structures. Some data structures are meant to be strict, others lazy. Haskell allows you to create data structures that are strict in the right places fairly cheaply.

Re:Introducing Haskell to a Company by akra on Tuesday October 02, 2018 @09:55PM (#18127112)
As a counter to this that may make it easier for a company to adopt and reduce the learning curve. Laziness can make it harder for some to reason about performance as an example.
Re:Introducing Haskell to a Company by vmchale on Wednesday October 03, 2018 @04:26PM (#18134521)
> Laziness can make it harder for some to reason about performance as an example.

Lots of people are fond of pointing this out, but very few are actually able to reason about performance of lazy data structures.

Re:Introducing Haskell to a Company by nestorD on Wednesday October 03, 2018 @04:13AM (#18128423)
The language does support laziness, it is just not the deafault.
Re:Introducing Haskell to a Company by nybble41 on Wednesday October 03, 2018 @01:49PM (#18132739)
The default is the whole point. Almost any language can support lazy evaluation, given enough boilerplate, but laziness-by-default is a major contributor toward making Haskell code more composable and reusable compared to idiomatic code in other languages.

In strict-by-default languages one must decide up front whether to permit evaluation to be deferred, and there is a cost to be paid via more awkward syntax to first capture the deferred computation and then explicitly evaluate it. This also tends to add runtime overhead which a Haskell compiler would optimize out in cases strict evaluation can be inferred. As a result, libraries generally expose only strict interfaces—and while most lazy functions can easily be made strict in Haskell with judicious application of `seq`, the reverse is not so simple.

Sure, sometimes excessive laziness becomes a problem. However, these cases are not that common, or particularly difficult for an moderately experienced Haskell coder to identify or work around. Enforcing strictness-by-default just because one does not foresee a need for laziness, without any evidence that laziness is negatively impacting performance, would be a form of premature optimization.