News for hackers. Stuff that matters.
Re:Haskell's Children by choeger on Wednesday September 23, 2020 @06:45AM (#24565372)
As I said elsewhere, the main contribution of Haskell is the science of programming languages. Without Haskell, we would be stuck with "practical" or "pragmatic" languages like C or Java that do not care much about soundness. Haskell is the science to Rust's engineering, IMO.
Re:Haskell's Children by pjmlp on Wednesday September 23, 2020 @07:18AM (#24565588)
As if Ada, Standard ML, Modula-3 weren't there first.

When I learned those, Haskell was still Miranda.

Re:Haskell's Children by johnnycerberus on Wednesday September 23, 2020 @07:22AM (#24565631)
SML inspired many languages: Elm, F#, F*, OCaml, Python, Rust, Scala, Modern Java(which looks more and more like an OCaml on the JVM), Julia

I really don't know why people think Haskell is the pinnacle of everything in PL design.

Re:Haskell's Children by fanf2 on Wednesday September 23, 2020 @03:31PM (#24570949)
I think part of it is that there aren't many functional programming languages with a standard specification, multiple implementations, lots of users, an active research community, and where results of research feed into the implementations and the standard.

Haskell ticks all these boxes.

SML has most of those things, except the last: it was effectively frozen in 2001. This is discussed in section 9.3 of the HOPL IV History of Standard ML https://dl.acm.org/doi/10.1145/3386336

OCaml lacks a standard and multiple implementations, and seems to me to be doing better than SML in the other areas.

Re:Haskell's Children by octachron on Wednesday September 23, 2020 @04:26PM (#24571585)
Isn't GHC the only full implementation of Haskell 2010? I am not sure how much the multiple implementations matter when there is only one full implementation of the last specification, which itself lags 10 year behind the only implementation massively used.
Re:Haskell's Children by choeger on Wednesday September 23, 2020 @05:00PM (#24571969)
Haskell certainly is not the pinnacle in language design.

IMHO it is the first successfully implemented research language, though. I think that Haskell is the first language that, at the same time, had substantial commercial and research applications[1]. As such, it showed that the CS of PL is indeed of practical relevance.

Rust on the other hand, mostly applies this scientific research. And successfully so. Hence I call it the "engineering" part.

[1] To a certain degree this is also true for Lisp and SML, of course. But I think SML fell out of fashion quite quickly both in academia and industry. Lisp is, well, lisp. People that start using it seldom search for another language afterwards.

Re:Haskell's Children by pjmlp on Wednesday September 23, 2020 @07:44AM (#24565815)
Having learned programming in those days, it feels really weird that now is fashionable to assert that Haskell === FP.
Re:Haskell's Children by mrkeen on Wednesday September 23, 2020 @10:58AM (#24567873)
I can explain it this way:

If you were a Java/C/C# programmer in the 2000s, you missed out on:

  * lambda abstractions
  * Generics (prior to 2004)
  * Higher-kinded Generics
  * Primitives in Generic collections
  * no nulls
  * do-notation
  * ML type system
  * global, decidable type inference
  * Pattern matching
  * Functions as first-class objects
  * Currying
  * And most importantly *side-effect-free* functions
As a someone who picked up Haskell around 2010 as my first functional language, I liked what I saw, and I assumed that other functional languages were probably similar. My inner evangelist was all "You should use FP instead of Java, because lambdas are ergonomic", "You should use FP because nulls are bad", "You should use FP because functions are easier to test than methods".

Over the last decade I've realised that those statements aren't really truthful. Many functional languages allow null. Many functional languages won't enforce side-effect-free functions for you. So it was never really about FP, it was about Haskell. Anyway, that's how they got conflated in my mind.

Re:Haskell's Children by Ar-Curunir on Wednesday September 23, 2020 @11:14AM (#24568059)
SML has many of those features. Sure, Haskell popularized them, but it doesn't mean that computer scientists began studying these concepts only after Haskell became a thing
Re:Haskell's Children by mrkeen on Wednesday September 23, 2020 @12:04PM (#24568575)
> SML has many of those features

So does Java in 2020, but I was writing about:

>> it feels really weird that now is fashionable to assert that Haskell === FP

When Googling "functional programming", you get back pages of definitions emphasising "pure functions", "no side-effects", "mathematical functions", "avoiding shared state", "referential transparency". So what Haskell provides is what the blogosphere has been labeling as "functional programming" for a decade. Those definitions could be wrong, but they're the definitions that are floating around out there.

Re:Haskell's Children by ldeangelis on Wednesday September 23, 2020 @08:50AM (#24566364)
> Modern Java(which looks more and more like an OCaml on the JVM)

Could you please elaborate on that? Is it related to the new features, like lambdas, pattern matching with switch and so on?

Re:Haskell's Children by johnnycerberus on Wednesday September 23, 2020 @09:36AM (#24566878)
Algebraic Data Types (sealed classes/sum types + records/product types), pattern matching, local type inference. Moreover, Substrate VM (part of Graal) will help you achieve faster startup time and lower runtime memory overhead since it will be AOT compiled to a standalone executable, something that OCaml does right now.
Re:Haskell's Children by throwaway17_17 on Wednesday September 23, 2020 @10:30AM (#24567510)
While I know you are correct chronologically, it is 2020 now I think ‘network effects’ have come to dominate this perception (that Haskell is the language that gives the basis for breaking away from “practical languages). I think Haskell’s presence in the group consciousness of CS-minded developers is, at this point, due to the comparatively large web presence and semi-PR done on its behalf. Simon Peyton Jones almost single handedly pumps Haskell (and I love him for it) more than anyone pushes ADA, SML, and Modula put together.
Re:Haskell's Children by johnnycerberus on Wednesday September 23, 2020 @07:15AM (#24565565)
> Haskell is the science to Rust's engineering, IMO.

Wut? Rust doesn't have the purity and the capability to isolate side-effects that Haskell has. Rust is popular because of its ownership model that got into the mainstream. We still don't know what are the costs of it.

The only similarity between them is that both are statically typed, expression based languages (ex. Scala, Ruby, Wolfram, LISP) and moved the task of proving stuff from analysis tools to the programmer. But that doesn't mean that Haskell "is the science" behind anything. For what it's worth, Rust is closer to the ML (OCaml) family than Haskell, focusing on performance rather than purity. Though that is also debatable since it doesn't feature a GC and comes with zero-cost abstractions.

Rust has its very own merits. I'm eager to see how it will evolve and what hidden costs will be uncovered.

Re:Haskell's Children by pjmlp on Wednesday September 23, 2020 @07:19AM (#24565608)
For me the biggest merit Rust brings into the table is that affine types got out of the research lab, and now everyone is looking at ways to balance GC with affine types in most mainstream languages.
Re:Haskell's Children by johnnycerberus on Wednesday September 23, 2020 @09:02AM (#24566497)
> now everyone is looking at ways to balance GC with affine types in most mainstream languages.

Sounds interesting, do you have some links on this topic?

Re:Haskell's Children by scns on Wednesday September 23, 2020 @10:25AM (#24567437)
Niko Matsakis wrote his thesis in Scala IIRC. So Scala might have better shot at "the science behind Rust".
Re:Haskell's Children by Ar-Curunir on Wednesday September 23, 2020 @11:21AM (#24568125)
rustc was originally written in Ocaml. Rust just has lots of influences :)
Re:Haskell's Children by Ma8ee on Wednesday September 23, 2020 @08:18AM (#24566093)
What is genuinely new in Haskell that didn’t already exist in academic languages in the eighties?
Re:Haskell's Children by kryptiskt on Wednesday September 23, 2020 @08:37AM (#24566262)
Type classes and monadic IO (and having a type system being able to express monads as a thing).
Re:Haskell's Children by AnimalMuppet on Wednesday September 23, 2020 @01:14PM (#24569379)
Didn't stuff in the 80s have the ability to express monads, but nobody had yet realized that they were useful?
Re:Haskell's Children by kryptiskt on Wednesday September 23, 2020 @01:41PM (#24569747)
You can express particular monads, but to have a Monad class/trait for all monads you need first class type constructors (also known as higher-kinded types), and that is not common even today.
Re:Haskell's Children by momentoftop on Wednesday September 23, 2020 @07:15PM (#24573368)
SML has always let you abstract over type-constructors using modules, and it was always routine to do so. You can express monads abstractly in this way, and some people have (Ocaml, but the SML is the same modulo syntax):

http://batteries.forge.ocamlcore.org/doc.preview:batteries-b...

But the sort of code you would write in Haskell gets very noisy without typeclasses, and it's just not an obviously good way to program in a language that's intended to be impure and strict.