15 ms·
Haskell's Children
- johnday 6y agoInteresting article. I think it's worth explicitly calling out that rather than proclaiming the death of Haskell, this article is talking about the children of Haskell and what they are capable of doing from a clean slate and with a clear goal. IMO Haskell remains as the go-to language for teaching functional programming and for experimenting with PL concepts. Long may it remain.
- Athas 6y agoI also read it as there simply being some domains where Haskell is not well suited. I like using Haskell for writing compilers, but I would probably not like to use it for numerics code. While I could replace Haskell with Idris, I'm still a bit lukewarm on the cost-benefit of heavy use of dependent types for many programs (although Idris has other nice advantages unrelated to the type system).
- k_bx 6y agoTo me, Haskell got great at "get things done quickly". With Stack (and Stackage), initiatives like "Simple Haskell", and upcoming RecordDotSyntax, it truly becomes a weapon of pragmatic choice to knock out working software as quickly as possible. And a combination with Elm (and code-generation of Api.elm from Servant types) makes a perfect match for SPAs.
- mark_l_watson 6y agoI just looked through the Simple Haskell web site. I had not seen that before. I liked the Graham Hutton quote on having a secret plan to just use Haskell 98. For years, I enjoyed using Hugs via the iOS app Raskell. I still use Raskell but sadly it is no longer stable after an iOS update a year ago. Hugs, being an interpreter, is so fast for happy hacking activities.
- choeger 6y agoAs 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.
- johnnycerberus 6y ago> 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.
- pjmlp 6y agoFor 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.
- johnnycerberus 6y ago> 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?
- pjmlp 6y agoSure, several Swift https://swift.org/blog/swift-5-exclusivity/ https://swift.org/blog/swift-5-exclusivity/ https://github.com/apple/swift/blob/master/docs/OwnershipManifesto.md https://github.com/apple/swift/blob/master/docs/OwnershipMan... D https://dlang.org/blog/2019/07/15/ownership-and-borrowing-in-d/ https://dlang.org/blog/2019/07/15/ownership-and-borrowing-in... Haskell https://gitlab.haskell.org/ghc/ghc/-/wikis/linear-types https://gitlab.haskell.org/ghc/ghc/-/wikis/linear-types Chapel https://chapel-lang.org/docs/technotes/lifetimeChecking.html https://chapel-lang.org/docs/technotes/lifetimeChecking.html ParaSail https://adacore.github.io/ParaSail/ https://adacore.github.io/ParaSail/ Ada/SPARK 2014 proposal https://www.adacore.com/uploads/techPapers/Safe-Dynamic-Memory-Management-in-Ada-and-SPARK.pdf https://www.adacore.com/uploads/techPapers/Safe-Dynamic-Memo... Pony https://tutorial.ponylang.io/reference-capabilities/reference-capabilities.html https://tutorial.ponylang.io/reference-capabilities/referenc... Verona (very early stages) https://www.microsoft.com/en-us/research/project/project-verona/#!talks-workshops https://www.microsoft.com/en-us/research/project/project-ver...
- Hammershaft 6y agoNo write up on Unison? https://www.unisonweb.org/ https://www.unisonweb.org/ For me, Haskell is on the list of languages (right next to Smalltalk and Forth) that I would like to learn in the future just to experience problem solving from that vantage point, but it's taken me so long to work through SICP that I wonder if I have the time to meaningfully experience all these languages.
- eru 6y agoJust as an aside: I have fond memory of first working through SICP in my teens. But having recently revisited the book, I realised it's mostly nostalgia. There are better books about programming than SICP nowadays.
- Hammershaft 6y agoIt still has some mindblowing insights to share, but the length is a little intimidating. What books would you recommend instead?
- eru 6y agoOh, I didn't mind the length too much. You can benefit from each individual chapter. > What books would you recommend instead? 'Think Python' is a good introduction to programming in general. https://greenteapress.com/wp/think-python-2e/ https://greenteapress.com/wp/think-python-2e/ 'How To Design Programs' is another good introduction. https://htdp.org/2020-8-1/Book/part_preface.html https://htdp.org/2020-8-1/Book/part_preface.html For functional programming in general, Okasaki's 'Purely Functional Datastructures' is a real treat. Paul Graham's 'On Lisp' is worth reading. It's a bit on the pragmatic side. http://www.paulgraham.com/onlisp.html http://www.paulgraham.com/onlisp.html Above all of them, the best book in general is 'The Pleasures of Counting'.
- dwhitney 6y agoUnison is truly doing something different and new. Totally worth checking out.
- pjmlp 6y agoJulia is a child of CLOS and Dylan, nothing to do with Haskell. https://en.wikipedia.org/wiki/Common_Lisp_Object_System https://en.wikipedia.org/wiki/Common_Lisp_Object_System https://opendylan.org/documentation/ https://opendylan.org/documentation/
- _query 6y agoHaskell is not at a tipping point yet where it's losing it's excitement. E.g. with RecordDotSyntax and the new haskell language server many longstanding pain points will be solved soon. There's especially lot's of excitement around haskell and web web development. Take a look at what we're doing with IHP: https://www.youtube.com/watch?v=UbDtS_mUMpI&feature=emb_title https://www.youtube.com/watch?v=UbDtS_mUMpI&feature=emb_titl... https://ihp.digitallyinduced.com/ https://ihp.digitallyinduced.com/ Soon you can even deploy haskell web apps in 15 seconds: https://twitter.com/larsparsfromage/status/1306653917187649537 https://twitter.com/larsparsfromage/status/13066539171876495... Growing between 5% and 10% weekly. Many new people are starting their journey into haskell with IHP :-) While the community might be changing, it's definitly not dying.
- klelatti 6y agoCould you please specify what is growing between 5% and 10% weekly and for how long? Thanks.
- mxschumacher 6y agomaybe OP is referring to memory allocation during compilation?
- _query 6y agoCompared to many modern javascript apps haskell's memory usage is actually pretty good :)
- bird_monster 6y agoWhat an excellent comparison :)
- _query 6y agoCommunity size. Measured by: Downloads, GitHub Stars, people in our gitter channel, twitter followers, Newsletter Subscribers, Youtube Reach. E.g. on Sep 1. we had 870 GitHub stars and 321 Twitter Followers. Now (23 Sep) we're at 970 GitHub stars and 487 followers. IHP has been launched around 3 months ago. So we're measuring it since then.
- dangirsh 6y agoThere was a fantastic talk at JuliaCon 2020 about applied category theory in Julia: https://youtu.be/7zr2qnud4XM https://youtu.be/7zr2qnud4XM
- fnord123 6y ago> It manages to be much faster than most dynamic languages ... It would be unfair to compare the performance of Rust and Haskell, because Haskell is optimized for things other than performance. Hmm... > When I first started using Rust, I really missed monads. Option and Result are Monads. Surely he misses do-notation. > This all being said, I think it is worth looking at the features that are prominent in Haskell that ended up going to Rust ...[list of features that Rust got from SML/ocaml] Here are the officially stated Rust influences: https://doc.rust-lang.org/reference/influences.html https://doc.rust-lang.org/reference/influences.html To say that Rust is a child of Haskell is really overstating the case.
- eru 6y ago> Option and Result are Monads. Surely he misses do-notation. Well, functions and lists are also monads. I guess what the author means is that the language recognises the similarity of those disparate structures.
- dimitrios1 6y agoIIRC Rust was influenced more by OCaml than Haskell, but I could be wrong. The article really rubbed me the wrong way with this tidbit > (we don’t talk about Go…) So since the author is speaking of "premier system’s language" we choose to ignore the world's premier cloud language? Interesting.
- zingplex 6y agoI'm pretty sure that was just a joke about Go's primitive type system.
- dimitrios1 6y agoI mean if we save the "intellectual superiority" of Haskells or other FP languages -- (I've used them all) -- in practice with teams of other engineers, and in production where it counts the most, Go has outshined them all. So primitive is surely a way to describe it.
- chriswarbo 6y agoI'd claim that Scala is also heavily inspired by Haskell: it's probably closer to ML, but so is Rust (which is on the list). Heavy use of 'flatMap' (i.e. monadic bind) is clearly Haskell-inspired, and this is more obvious in popular libraries like scalaz and cats. The 'for comprehension' language feature is clearly inspired by 'do notation' (IIRC Python's list comprehensions are inspired by Haskell's too). Elm is a more special-purpose child, but seems to have had an impact on JS practices, as a 'gateway' to functional programming. PureScript is also interesting but hasn't had as big an effect. I agree with the article that Idris is really nice; although I'd lump Agda in with it as a dependently-typed child of Haskell, and contrast them both against Coq (rather than lumping Agda and Coq together). I've also played around with Curry and found it quite interesting (functional logic programming), although it's essentially a research language.
- AzzieElbab 6y agoMore so by ocaml according to Odersky. I would argue that unhealthy obsession with bringing all of Haskell features to Scala actually hurt the language making it seem way more complicated than it actually is
- gnulinux 6y agoI code real life programs in Agda. Some part of my server and my tools are in Agda. One time I was in #haskell freenode IRC channels and people started acting out as if I'm some crazy person. Agda has seemless integration with Haskell. There is almost no friction writing 20% of your program in Haskell (unsafe) and 80% in Agda (safer). I personally believe, agda is an excellent programming language. It's stdlib is good, concepts and construct are very well-thought out, it's very safe and works surprisingly well. I've been programming in agda for years and almost never had issue implementing anything even though it's not Turing complete. Using sized types you can prove most sane things to terminate anyway. And if you really need infinite loops (say, you're implementing an interpreter of a Turing complete language) then you have many options: (1) disable termination checking for a single function (2) use Haskell to implement a single function (3) use Rust, C, C++ etc to implement a function then with GHC ffi link it to agda. Maybe I'm just being near sighted, but I'm really surprised more people don't use Agda or Idris in production. The number of times the type system saved my ass is uncountable. You can literally write unittests in your type system it fekkin runs your custom unittests while type checking. How is this not revolutionary? I don't understand.
- Cybiote 6y agoI enjoyed reading the perspective given in this essay and agree Haskell's been (and continues to be) an influential language. So take this criticism as maybe my being overly particular about the meaning of descendant. Idris as a descendant of Haskell I have no argument with. Rust however, is more correctly viewed as (primarily) a descendant of ML languages, which all possess the properties the articles lists as derived from Haskell. Perhaps it is more correct to call Haskell and Rust cousins, both deriving from the same lineage of languages. I would also not call Julia a child of Haskell. As it is more correctly viewed as an interpretation of Matlab as a Lisp, I'd therefore call Julia a descendant of Lisp. That Haskell single handedly popularized the utility of category theory in computing and that a category theory library is written in Julia does not make Julia a child of Haskell any more than it would have made Ocaml a child of Haskell (there used to be a category theory library written in Ocaml). The popularization of functional programming, Domain specific languages as algebras, reactive (not FRP), property based testing, parser combinators, model view update for UIs, design principles secretly based on monads are all but a few of the ways Haskell has influenced programming. Which is the core point of the essay and with which I am in full agreement. This thread somewhat has the air of an eulogy but it goes without saying that just because something is not the most popular in fashion does not mean it is dying.
- ChrisRackauckas 6y agoBut Catlab.jl is definitely a child of Haskell: the developers have said many times how much inspiration they've gotten from Haskell.
- feanaro 6y ago> Rust however, is more correctly viewed as (primarily) a descendant of ML languages, which all possess the properties the articles lists as derived from Haskell. Why would that be more correct? Would Rust have these features if they were not popularized by Haskell? I don't know the answer, but it seems like discussing which language some feature was taken, when more than one contemporary language has it, is a kind of meaningless pedantry.
- wtetzner 6y ago
- eganjs 6y agoI am a fan of Haskell, the biggest problem for me was installing stack/cabal. I eventually got there, but I recall it was a very painful and frustrating process. With that in mind I can advocate for it in good conscience. Managing ghc versions and creating/generating projects should made easy. I think rust got this right, rustup and cargo are great tools that are easy to install and work with.
- tome 6y agoI'm starting a (completely unofficial) project to understand the difficulties involved in getting started with Haskell. If you have the time and inclination I'd be much obliged if you would file a new issue explaining in more detail what points of pain and frustration you encountered: https://github.com/tomjaguarpaw/tilapia/issues/new https://github.com/tomjaguarpaw/tilapia/issues/new
- mark_l_watson 6y agoI hear you. I have made playing with Haskell much more enjoyable by doing two things: rely of stack and by have a fast multi core VPS so that long Haskell builds whenever I update to a new stack resolver version. I don’t do much Haskell on my laptops anymore.
- agambrahma 6y agoIMO the suggestion for anyone new to Haskell should be "just use Stack". It's easy to install, works out of the box. Cabal has fixed the problems from a few years ago, and Nix is a nice ecosystem to plug into, but these can get in the way at the beginning, at a point where the goal is to "create my first project, write my first program, build it, test it, run it".
- nautilus12 6y agoHaskell done right (TM) is objectively by every means slower. Both in terms of implementation and execution. You end up trading maintenance cost related to design for implementation cost and maintenance cost related to scaling which I may argue isn't really feasible in a pure Haskell approach. I base this upon personally experience witnesses a haskell system serve something like 10 requests per second when a comparable implementation in Scala or rust or go could have easily done 10000
- the_af 6y agoHow do you know this Haskell system was "Haskell done right"? I'm not trying to be snarky, this is a genuine question. I have witnessed enough disasters (performance or otherwise) in multiple languages to know not draw conclusions from just one or two failures. Of course, consistent failures by multiple teams do point to a problem with the technology itself. (Then again, maybe you do have multiple examples and/or have strong evidence this system was indeed "Haskell done right", which is why I'm asking).
- nautilus12 6y agoWell, its hard to tell not being a haskell advocate, but the people building the systems were haskell experts with years and years of that being their only language and were extremely particular about the implementation, which is part of the reason why they justified the 10 requests per second part, is because it was "done right". My understanding is that haskell is designed is such a way that certain things are impossible to do any way but the "right way", so its also just fundamental by merit of the fact that they were using haskell to solve those particular problems. But it was mostly clout and the fact that the implementation was so thorough and the people building it were like phd level experts in haskell/category theory.
- kdkeyser 6y agoI think what you witnessed is the fact that being an expert in programming language theory or category theory, does not make you a good software engineer. Haskell is surprisingly well suited for back-end services (e.g REST). Warp (an HTTP server), Servant (a way to define your backend API), and Mio [1] (the Haskell network IO implementation) are amazingly performant and scalable. Of course, that does not prevent you from messing up on the business logic level. I suspect that they lacked awareness of performance implications of their choices, this is not something Haskell will save you from. On the contrary, parts of the Haskell community do tend to go to over-abstraction, and I believe this does have a negative effect on people writing production software. [1] https://dl.acm.org/doi/abs/10.1145/2503778.2503790 https://dl.acm.org/doi/abs/10.1145/2503778.2503790
- AzzieElbab 6y agoElm should have made the list. It is a dsl for creating web uis. Nothing comes close to Haskell’s being a dsl for creating dsls
- dwhitney 6y agoElm, but not PureScript?!? :) I use PureScript everyday, and I love it. It's nearly identical to Haskell, with a few small changes that can be described on about a page
- AzzieElbab 6y agoYeah, forgot about Purescript. Always thought of it as just basically Haskell :)
- a_imho 6y agoRust, Idris, Julia - pretty arbitrary imo.
- jjice 6y agoI personally think that the most important impact that functional languages make isn't in their direct use (which can be very powerful), but more so in their influence. Bringing functional features into more main stream languages allows everyone to take advantage of powerful features/patterns. The first one that comes to mind is pattern matching. All your ML derivatives have had it for years, and it's an extremely powerful concept. Unfortunately, most people (myself included) had never heard of it until it hit more main stream languages like Rust and C#. Streams and the more wide spread use of anonymous functions is another great example of functional concepts making imperative languages much more expressive and powerful. I don't like writing in pure functional languages very much, but I do enjoy a lot of the power the have and how we can make these concepts more accessible to traditional imperative languages.
- callamdelaney 6y agoErlang pattern matching makes using the language a pleasure, I find Rust's implementation less flexible.
- sevensor 6y agoThe author seems to like Julia for numerics -- have the language and community improved since Dan Luu's damning review six years ago? https://danluu.com/julialang/ https://danluu.com/julialang/ I use Python / numpy heavily, and the giant hole numpy opens in my type annotations causes me grief daily. If there's something better out there, I want to try it, but it has to work. It has to work not just in the "I'm putting together a journal article and I need it to run" sense, but in the "I'm building a system that crunches some heavy engineering numbers all the time, and customers expect consistent results" sense. Can Julia be trusted?
- ddragon 6y agoThat was just around 2 years after the language became public and 4 years before it became stable, so I wouldn't really call the language "mature" back then (I didn't use the language then to have the insight even if I got before 1.0). From what I can see, the core developers seem to take seriously bug reports, even implementing sophisticated ways to accurately find the source of bugs [1] and running tests on the entire ecosystem before each new tagged release to catch bugs early. There are many large scientific projects using Julia [2], and there are industry leader packages in the area like DiffEq.jl. The "time to first plot" (a consequence of the aggressive JIT that compiles large programs with heavy optimizations, as Julia doesn't have an interpreter outside of the debugger) still exists, but it is also improving at a fast rate. [1] https://julialang.org/blog/2020/05/rr/ https://julialang.org/blog/2020/05/rr/ [2] https://juliacomputing.com/case-studies/ https://juliacomputing.com/case-studies/ [3] https://github.com/JuliaPlots/Plots.jl/issues/2838#issuecomment-683159124 https://github.com/JuliaPlots/Plots.jl/issues/2838#issuecomm...
- eigenspace 6y agoEven back then, Dan's blogpost was misleading at best.
- lioeters 6y agoThe most recent relevant discussion about Julia I found is: JuliaCon2020: Julia Is Production Ready - https://bkamins.github.io/julialang/2020/08/07/production-ready.html https://bkamins.github.io/julialang/2020/08/07/production-re... Discussion: https://news.ycombinator.com/item?id=24082281 https://news.ycombinator.com/item?id=24082281 There are comments suggesting that Julia is plenty capable, with libraries covering equivalent (or more) features provided by Python libraries like NumPy. YMMV.
- contrafunctor 6y agoOP here. I just have one thing to say. In the real world (i.e., unlike in a tree), children have multiple parents.
- earthboundkid 6y agoI've made this comment before, while Haskell has succeeded in terms of inspiring other programming languages, as a language for use itself it's a non-entity. Here's a list of all the popular open source Haskell software: - XMonad - Pandoc - Shellcheck Everything else is just tools for using Haskell (Cabal etc.). Seriously, compare: - Haskell https://github.com/search?l=&o=desc&q=stars%3A%3E1000+language%3AHaskell&s=stars&type=Repositories https://github.com/search?l=&o=desc&q=stars%3A%3E1000+langua... - Rust https://github.com/search?l=&o=desc&q=stars%3A%3E1000+language%3ARust&s=stars&type=Repositories https://github.com/search?l=&o=desc&q=stars%3A%3E1000+langua... - Dart https://github.com/search?l=&o=desc&q=stars%3A%3E1000+language%3ADart&s=stars&type=Repositories https://github.com/search?l=&o=desc&q=stars%3A%3E1000+langua... Haskell has been around for a long time. It's not just "avoiding success at all costs," it's a nothing. It inspired good features like Option and Maybe in other languages, but it itself is on the same scale as Dart.
- ehw3 6y agoAs someone too dumb to learn Haskell or Category theory, it blows my mind that someone who says he is four years from being a teenager wrote this.
- bad_user 6y agoWorking with Haskell requires no Category Theory. It's a fun language, and if you play with it and its ecosystem, it might give you ideas to import in your own environment. Pick up a good book, and learn it, because it's fun. And no, you're not too dumb to learn it. Java and its ecosystem can be more complicated IMO, you don't realize it because you've put years in learning it.
- da39a3ee 6y agoAgreed it requires no category theory, but I'm an experienced programmer in a few languages and I've found it very hard to learn. I can get to a basic level, where I write rather verbose programs because of all the recursion and immutability, and I sense that I need to make better to use of the core abstractions that the language is known for (those with names which point to concepts in abstract algebra and category theory), and I've totally failed to do that in the two times I've spent a few weeks trying to learn. Advice gratefully received!
- deleted 6y ago[deleted]
- bogomipz 6y agoThe author states: >"The type system in Rust is obviously very influenced by the type system of Haskell, but they also implemented “ownership” which allows for the killer feature garbage-collection free automatic memory management." I always assumed that garbage collection was simply a convenience offered by a particular language. I was also under the impression that memory leaks were the class of problems that were addressed by garbage collection and that memory safety was a class of problems that was concerned with things like buffer overflows and corruption and addressed by runtime checks. However after reading I feel like I have failed to understand the role of garbage collection in enforcing memory safety. Is memory management and memory safety not so cleanly divided? Could someone explain or point me to a good resource for understanding how garbage collection is used to enforce memory safety?
- steveklabnik 6y agoYou can think of it as kind of the inverse of leaks; if fixing a leak is "hey, this isn't used anymore, let's clean it up," fixing memory safety is "hey, this is still used, don't free it yet!" Does that make sense?
- bogomipz 6y agoYes both of these responses were helpful. Cheers.
- Jtsummers 6y agoThe common memory-related bugs are: - use after free - memory leaks (failing to free) - concurrent and uncontrolled access from multiple threads (race conditions) Garbage collection helps with the first two. The system will not free memory until it is certain (by whatever method is being used) that the memory is no longer in use. But this comes with a run-time cost. Rust's innovation here is a more reliable way of tracking memory usage statically, and removes some of the run-time cost. Paired with its ownership/borrow mechanisms it also works to solve the third issue, which GC doesn't deal with at all.
- adchari 6y agoGarbage collection is also limited, you can still effectively create “memory leaks” if you hold a reference to something you’re not longer using.
- markstos 6y agoPerl 6 was also inspired in part by Haskell. An early version of Perl 6 was written in Haskell, which led to further Haskell influence on the language.
- lizmat 6y agoPlease note that Perl 6 has been renamed to Raku (https://raku.org https://raku.org using the #rakulang tag on social media).
- zeckalpha 6y agoAll these languages existed 5 years ago... I’m not sold on the time travel premise.