3 ms·
It remains a bit bitter sweet to see that so many features that we’ve had for 13+ years in Scala and longer in languages like Haskell and were ridiculed back th
by spockz 3y ago
It remains a bit bitter sweet to see that so many features that we’ve had for 13+ years in Scala and longer in languages like Haskell and were ridiculed back then, now find their way to mainstream Java.
- zokier 3y agoRidiculed? Really?
- earthboundkid 3y agoThe only Haskell feature I can think of people ridiculing is laziness, which makes sense because it sucks and makes performance hard to reason about.
- earthboundkid 3y agoOh and burritos. Burritos are funny.
- the_af 3y agoThey only ridicule it because they don't use it or understand it. Laziness by default is my favorite Haskell feature.
- BaseballPhysics 3y agoSo you've never had a space leak? Be honest...
- the_af 3y agoI've seen lots of things and problems in languages both with and without lazy evaluation. On the whole, I like it in Haskell. In languages without lazy evaluation (by default) I tend to miss it. I've never seen it "ridiculed" by anyone proficient with the language or who used it for an actual project, either.
- BaseballPhysics 3y agoGreat non-answer. Meanwhile, no honest Haskell developer can claim to have never been surprised by a space leak at one time or another. Why? Becauze laziness is simply harder to reason about. It's a lot like coding in something like Prolog, in that you need to internalize not just the behaviour of the program, but the behaviour of the Haskell runtime as well, and how laziness is actually implemented. This makes it very challenge to reason about both space and time reliably, even for a seasoned developer. The fact that whole tutorials are dedicated to picking the right fold so you don't leak space is a perfect encapsulation of the problem. And for a language that emphasizes compile-time safety, it's a major class of bug that neither the compiler nor runtime help the user detect. I've worked in many different languages and runtimes over the years and I've never encountered another feature that was equally complex.
- the_af 3y ago> Great non-answer. Meanwhile, no honest Haskell developer can claim to have never been surprised by a space leak at one time or another I did answer. I've been hit by them. In general, the problems are fewer than without laziness, though. I've seen more problems in production caused by careless eager evaluation. Are you an "honest Haskell developer" by the way, that you speak for all of them? "Be honest" in your answer, please. > Becauze laziness is simply harder to reason about. No, it's harder to reason about some aspects and easier to reason about some others, like gluing together code. > I've worked in many different languages But not Haskell, right? "Be honest". I've never seen laziness ridiculed (not critiqued, but ridiculed, remember the context of the conversation you're in) by an actual practitioner, have you? "Be honest".
- BaseballPhysics 3y ago> But not Haskell, right? "Be honest". I absolutely have worked with Haskell and written a number of non-trivial programs in it, including a bytecode interpreter for a toy virtual machine. I also spent quite a bit of time writing solutions to various coding challenges in Haskell, which gave me an appreciation for how hard it is to write high performance code in the language (anything touching strings, in particular, was a real joy...). I've never felt like I had to fight the runtime quite the way that I had to fight it with Haskell. But yes, if I'm writing normal, run-of-the-mill, low complexity code, it's pretty easy to get Haskell right. But then in that circumstance it's easy to get it right in any language. Of course, why would you believe me? You're already so sure your opinion is fact that I doubt anything I have to say will sway you.
- the-smug-one 3y agoI'm sure you can find a flame war or three about pattern matching. Oh boy, the threads you'd have 10 years ago about this stuff.
- lmm 3y agoYes, ridiculed. E.g. someone posting (presumably trolling) /r/scala today: "I just wonder how can people think something as arcane and absolutely out of this world as the typelevel stack or ZIO can have a place in the industry."
- augustk 3y agoI also wonder if perfection is reached when there is nothing more to add ;-) Current popular languages seem to converge.
- wongarsu 3y agoOne major upside of newer languages like rust is that they can start out with these "newer" primitives, with a standard library designed around them and without tons of "legacy primitives" that do the same thing, but worse (like how python has 4+ distinct ways to print a string with variables in it, all in various degrees of popular use). Once your language has aged a little it's hard to impossible to take old primitives away, but you still want to adopt ergonomic improvements in order to not be left behind. Until at some point you become a language nobody can master in its entirety.
- _a_a_a_ 3y agoThey seem to be converging on Scala :)
- clhodapp 3y agoThey're converging on Kotlin, but of course 75% of the difference between Java and Kotlin consists of Scala features that have been laundered of their dirty "academic" origins for acceptance in polite industry.
- speed_spread 3y agoAnd it'll be another 5 years before JDK21 becomes a widespread target for production and then another 5 years for the new features to be accepted in code reviews. Culture changes slowly.
- heelix 3y agoThink SpringBoot might just change that. Folks are scrambling to move to 3.x, with 2.7.x hitting public EOL this November. With SpringBoot 3 requiring Java 17 at a minimum and Java 21 coming out this fall, I suspect our shop will see many people just move to the latest LTS when it is available.
- dikei 3y agoI think it'll be much faster this time around. We took way less time to move from Java 11 to 17 compare to the 8 -> 11 migration due to the change in deployment methods: instead of deploying jar file and run it with the server-provided JRE, we now use docker to ship our app + JRE to server.
- oh_sigh 3y agoOn the flip side, how many features are in those languages that java benefited from not introducing?
- lmm 3y agoI can only think of XML literals (which Scala did eventually manage to remove) and the first version of value types. (Plus some new things in Scala 3 which time will tell about). From Haskell maybe Python-style list comprehensions (Haskell has two sets of syntax sugar for using monads more easily and Python took the bad one). Pretty poor tradeoff on the whole if you ask me - but Scala is always there for anyone with enough sense to pick it up.
- monksy 3y agoThis feels like Option/Optional all over again.
- kaba0 3y agoOne might say that the general developer community has only recently became ready for many FP ideas.