News for hackers. Stuff that matters.
Re:Haskell for a New Decade [pdf] by chrisseaton on Tuesday June 23, 2020 @07:19PM (#23621661)
> Then there are language features in C# and Java, Typescript etc. that are coming across from Haskell.

What language features in Java came from Haskell?

Re:Haskell for a New Decade [pdf] by quickthrower2 on Tuesday June 23, 2020 @07:29PM (#23621763)
Stream API would be my first thought but I am not as familiar with Java. Maybe I should have said "ideas", I'm not sure there are any language level changes for Stream API.
Re:Haskell for a New Decade [pdf] by chrisseaton on Tuesday June 23, 2020 @07:38PM (#23621865)
> Stream API would be my first thought but I am not as familiar with Java.

Can you name any design characteristics in Java's stream API that came from Haskell, rather than were already common in many languages when Haskell itself was designed? I can't.

Re:Haskell for a New Decade [pdf] by atombender on Wednesday June 24, 2020 @01:23AM (#23624392)
Java's "stream fusion" is inspired by the same technique that was originally implemented, I believe, in Haskell [1].

[1] http://fun.cs.tufts.edu/stream-fusion.pdf

Re:Haskell for a New Decade [pdf] by chrisseaton on Wednesday June 24, 2020 @06:45AM (#23626402)
But Java doesn't do stream fusion as you're describing.

It does conventional inlining and combining loop bodies, which can in some trivial cases achieve the same effect, but these are techniques you'd find in any compiler or even an 80s text book - they didn't come from Haskell.

Here's the limitation of Java's 'fusion' - you'll notice there's no pass to do this in Hotspot - it just happens due to the inlining and GCM passes.

https://github.com/openjdk/jdk/blob/883a4f65b9b1533c8a51d156...

And here's a paper on trying to add actual Fusion to Java, which they wouldn't be doing if Java had it already.

https://dl.acm.org/doi/pdf/10.1145/3355378.3355386?download=...

Re:Haskell for a New Decade [pdf] by diablerouge on Tuesday June 23, 2020 @07:30PM (#23621775)
Generics, no? Philip Wadler, one of the designers of Haskell, was involved with the introduction of generics to Java.
Re:Haskell for a New Decade [pdf] by chrisseaton on Tuesday June 23, 2020 @07:37PM (#23621852)
The original paper on Java generics as we know them today only mentions Haskell twice, both times in passing.

Once in reference to something that they didn't do (algebraic types), and once in reference to that both Haskell and their work were being inspired by an earlier common idea (System F) from the early 1970s.

Re:Haskell for a New Decade [pdf] by waltpad on Wednesday June 24, 2020 @04:36AM (#23625599)
I don't think these technologies are related: Java Generics is based on subtyping, however Haskell doesn't support subtyping (afaik).
Re:Haskell for a New Decade [pdf] by JoelMcCracken on Tuesday June 23, 2020 @07:44PM (#23621915)
Lambdas?
Re:Haskell for a New Decade [pdf] by chrisseaton on Tuesday June 23, 2020 @07:45PM (#23621928)
But those were popular and common before Haskell. Why would we say that lambdas spun off from Haskell to Java, rather than they were spun off from ML, or Miranda, or from Lisp?
Re:Haskell for a New Decade [pdf] by JoelMcCracken on Tuesday June 23, 2020 @07:54PM (#23622002)
I can’t say really, but my recollection is that the last decade of higher interest in FP has had Haskell as a fixture, and was significantly sparked by the need to program in a multi core world, and parallelization is made significantly simpler in the context of pure FP and controlled side effects.

I hear you though. I was mostly a lisp person and only really got into Haskell in the last couple of years. Even still I would have said that the FP zeitgeist had Haskell as it’s central example of FP.

Re:Haskell for a New Decade [pdf] by lptk on Friday June 26, 2020 @02:13PM (#23655118)
I think it's safe to say that the inspiration for Java lambda almost certainly did not come from the "FP zeitgeist" you're describing, but simply from other JVM languages like Scala and Clojure, which showed how useful they were and how they could be done nicely on the JVM.
Re:Haskell for a New Decade [pdf] by JoelMcCracken on Saturday June 27, 2020 @03:39PM (#23664086)
I believe both of those languages have motivational roots in the parallel computation drive/what I am describing as the FP zeitgeist.

For example, this ya the earliest reference to clojure I could find on hn. Notice the text of the announcement and how it focuses on parallelism https://groups.google.com/forum/m/#!topic/comp.lang.lisp/xvK...