News for hackers. Stuff that matters.
Re:Dhall: A Gateway Drug to Haskell by picozeta on Tuesday June 07, 2022 @04:16PM (#31659558)
In my opinion Haskell's capabilities to help implement general-purpose SW (services, compilers, GUI, game-dev, systems) are way over-hyped.

Sure, it's nice to implement parsers/compilers in it (see ̶N̶̶̶i̶̶̶x̶̶̶, Elm, DHall) and it's to some extent popular for backend web development, but I don't think the strong static type system is such an advantage as advocates want you to believe.

Of course it's safer (and faster) than dynamic languages like Python (Ruby, JavaScript), but in my personal opinion, you don't gain that much if you compare it to something like Rust, Java or even Go.

In particular the common abstractions (Monad, Applicative, Functor) are used very differently in different libraries (everyone seems to want to write her own DSL), so it's hard to get comfortable with third party libraries.

Furthermore it's still the case, that there's not much really interesting SW made in it. Some years ago you could argue, it's because of familiarity, but (static typed) functional programming is part of CS curricula for at least 10 to 20 years now.

Lastly it's just incredible hard to estimate runtime characteristics (clock-time, memory usage), because you never know which compiler optimizations kick in or not.

It's a nice language, but again, I don't think it's such a panacea as proponents often tell you.

And to be snarky: If Haskell is such an advanced language to make implementing reliable SW such a breeze, it should be part (maybe as a dependency) of more SW.

EDIT: Nix is implemented in C++ as correctly pointed out in a comment.

Re:Dhall: A Gateway Drug to Haskell by caconym_ on Tuesday June 07, 2022 @07:36PM (#31661367)
In trying to figure out why Haskell hasn't been widely adopted, I think it's very hard to disentangle legitimate criticisms of the language (unpredictable performance, overcomplicated and bizarre APIs, etc.) from the simple fact that learning it with an imperative background is like starting from scratch, even for experienced programmers. This is true even if you look at the base language, without involving Template Haskell or any of the weird language extensions.

Ultimately, asking programmers to relearn how to be programmers (or, more relevantly, asking businesses to accept that overhead and/or a vastly reduced hiring pool) is just too large of an ask for whatever marginal gain you might expect from using a "superior" programming language.

To be clear, I learned Haskell for fun and got to what I'd consider an intermediate level of expertise. It was an incredibly enriching experience, and gave me a new perspective on programming in general. But it was hard, and the rabbit hole just keeps going---sure, you can juggle monads in your sleep, but are you proficient with the `lens` library? No? Well, I can recommend you a pile of textbooks that might help.

Re:Dhall: A Gateway Drug to Haskell by quadrifoliate on Tuesday June 07, 2022 @09:51PM (#31662332)
> ...earning it with an imperative background is like starting from scratch, even for experienced programmers. This is true even if you look at the base language, without involving Template Haskell or any of the weird language extensions.

As a somewhat experienced programmer, I would actually say that the language extensions are an important part in disincentivizing learning Haskell for me, because even if I learn the base language, it seems like I would need to understand all these weird extensions to read real-life code, which always seems to involve half a dozen of them.

Re:Dhall: A Gateway Drug to Haskell by mbrodersen on Tuesday June 07, 2022 @11:10PM (#31662740)
Yep agree. Keeping track of what all the language extensions do is not worth the effort compared with more leading edge languages like Agda and Idris.
Re:Dhall: A Gateway Drug to Haskell by ParetoOptimal on Wednesday June 08, 2022 @12:10AM (#31663095)
As of GHC 9.0.2 the GHC2021 language pragma is available and it consists of the most popular language extensions.

https://downloads.haskell.org/~ghc/9.2.1/docs/html/users_gui...

Also typically language extensions are pretty simple, single purpose, and well documented.

Re:Dhall: A Gateway Drug to Haskell by quadrifoliate on Wednesday June 08, 2022 @01:25AM (#31663563)
> Also typically language extensions are pretty simple, single purpose, and well documented.

I will try again to explain with an example how these extensions are borderline user-hostile.

One of those extensions in your article linked above is apparently something called `DoAndIfThenElse` which enables if..then..else syntax with if and then on the same line, so far as I can tell [1].

When building programs that assume this extension without declaring that pragma, you get helpful error messages like "Unexpected semi-colons in conditional" [2]. Dealing with oddities like this seems to be routine any time I work on a Haskell project that's not a tutorial, and the constant need to go hunting for these error messages and add random pragma headers saps energy and is discouraging.

There also seems to be an open issue about the extension being undocumented [3], which would seem to contradict your "well documented" claim.

Given such significant problems in a relatively simple extension, I cannot even imagine how bad things are in more complex cases. I think whoever is steering the ship in Haskell/GHC land should really focus on ways to freeze new language extensions, and make the current ones well-documented in addition to providing options like the one you linked. Newer languages have environments that are much friendlier towards newcomers in terms of both documentation and (for lack of a better word) runnability of real-world code.

----------------------------------------

[1] I would really like to know why this is considered a popular language extension, and/or why it was needed, but let's skip over that for the moment.

[2] https://kseo.github.io/posts/2014-01-13-DoAndIfThenElse-lang...

[3] https://gitlab.haskell.org/ghc/ghc/-/issues/18631

Re:Dhall: A Gateway Drug to Haskell by ParetoOptimal on Wednesday June 08, 2022 @02:56AM (#31664202)
> When building programs that assume this extension without declaring that pragma, you get helpful error messages like "Unexpected semi-colons in conditional" [2]. Dealing with oddities like this seems to be routine any time I work on a Haskell project that's not a tutorial, and the constant need to go hunting for these error messages and add random pragma headers saps energy and is discouraging.

Well thats kind of the point of the GHC2021 extension. It will be a standard so that new programmers that format if else statements as they would in other languages don't get a weird error that very much does SAP their energy.

> There also seems to be an open issue about the extension being undocumented [3], which would seem to contradict your "well documented" claim.

It certainly calls it into question, though I did say typically. I'm open to weakening to "many times" if there are more than a few other examples.

> Given such significant problems in a relatively simple extension, I cannot even imagine how bad things are in more complex cases.

The problems described occur as a result of the extension not being turned on, so I find the logic doesn't work here.

Re:Dhall: A Gateway Drug to Haskell by klysm on Wednesday June 08, 2022 @12:25AM (#31663177)
Is this structured like rust editions? If so I think that could be very useful for the ecosystem.
Re:Dhall: A Gateway Drug to Haskell by krab on Wednesday June 08, 2022 @01:31AM (#31663612)
Yes! Make a new version of the language that includes the used extensions, freeze it for a while, add a few chapters to Learn You a Haskell. That would improve the experience of a learner who wants to move from toys to real projects.
Re:Dhall: A Gateway Drug to Haskell by vintermann on Wednesday June 08, 2022 @07:48AM (#31665940)
Back when I learned it, it may have been true that Haskell's adoption was hurt by functional programming being an exotic thing.

But that isn't really the case today, is it? Almost all the cool power features of Haskell have been adopted by the rest of the world. Type inference, pattern matching, explicit nulls, algebraic data structures, rich type systems... although it isn't usually enforced, the world has woken up to the fact that "mutable state is dangerous and should be avoided whenever possible". Writing a program without any reassignment isn't nearly as alien to a programmer starting out today as it was 20 years ago. Back then, even passing a function as an argument was edgy (and, in C/C++, risky).

I think what's hampered Haskell, and made at least me reluctant to pick it up again, is that for all the ridiculous talent working on Haskell, there hasn't come some brilliant fix to the space leaks thing. Almost as if there's something fundamentally hard about composability and laziness. I'm really not sold on laziness by default anymore, it costs so much more than it tastes - and for everything else, Haskell is a victim of its own success in that so many of the things it pioneered has gone mainstream.

Re:Dhall: A Gateway Drug to Haskell by caconym_ on Wednesday June 08, 2022 @11:29AM (#31668821)
I wrote a bit about this here: https://news.ycombinator.com/item?id=31663316

In brief, I think Haskell is still the purest expression of what makes it great. This is both a good thing, for the reasons I outlined there, and a bad thing, because e.g. stringing together a few iterator methods in Rust may be a functional style but it still prepares you for the concepts you'll encounter in Haskell about as well as zooming a Hot Wheels around on the kitchen floor prepares you to drive a lap in an F1 car without stalling out or flying off the track.

People with a modern imperative background know this intuitively---or maybe they just assume it, and happen to be correct---as soon as they look at a page of nontrivial Haskell code.

One thing people seem to miss about laziness in Haskell is that it's (unfortunately?) really tightly coupled with how "control structures" are expressed. For instance, instead of writing a loop with some infinite or indefinite condition, you might declare a list using a generator function and iterate over its values. I would like to see how other similar languages (e.g. Purescript) have done away with it, and how it impacts them. But my recollection from when I actually knew Haskell is that it was an incredibly powerful feature tightly integrated with the language design, not only from a data perspective but also from a perspective of allowing code structures to map much more closely onto the data structures they're manipulating.

(This is a big part of why, as I think I mentioned somewhere else in this thread, Haskell is so ergonomically suited for working with tree-like linked data structures.)

Re:Dhall: A Gateway Drug to Haskell by jose_zap on Wednesday June 08, 2022 @08:32AM (#31666309)
You can do enable strict evaluation by default in Haskell, though. So, that must not be the reason why the language is not mainstream.

More likely, network effects can explain how something makes it to the mainstream. For example having a big corporation behind the development and marketing of the language.

Re:Dhall: A Gateway Drug to Haskell by anitil on Tuesday June 07, 2022 @07:48PM (#31661460)
This is where I'm at. I don't know if I'll ever get useful software out of it, but I really enjoy the mental challenge. I actually find it a bit of an ugly language to look at (backticks, hanging single quotes etc) but I like how it reveals the underlying structure of problems that I haven't been able too replicate in other languages.

Though I'd recommend a youtube channel called 'Low Level Javascript' (really!) which comes close in developing some of their parser combinator library.

Re:Dhall: A Gateway Drug to Haskell by toastal on Wednesday June 08, 2022 @12:44AM (#31663304)
Hanging single quotation marks? You mean the ‘prime’ symbol? This comes up a lot in math to generate more variables that need a similar name—that’s why it ends up in Haskell and related languages. It’s not something weird.

Granted the ASCII tick/apostrophe is neither the proper symbol for primes nor quotation marks (should be curly), but programmers are reluctant towards Unicode.

Re:Dhall: A Gateway Drug to Haskell by y2bd on Tuesday June 07, 2022 @09:10PM (#31662070)
What about Rust? Rust doesn’t go as in-depth as Haskell when it comes to modeling effects in the type system, but it still has a relatively complex type system on top of dealing with the borrow checker (which is almost as joked about as Monads at this point). Even with that difficulty, Rust seems to be a lot more successful than Haskell, and has existed for far less time.

If it’s because Rust is still mostly imperative, then you could look to Clojure or even Scala—less complicated when it comes to types, but also (usually) much less imperative. Both I feel are more popular than Haskell.

Re:Dhall: A Gateway Drug to Haskell by caconym_ on Tuesday June 07, 2022 @09:59PM (#31662366)
I was thinking about Rust a lot when I wrote this comment, actually.

IMO, imperative vs. functional aside, Rust does suffer from a lot of the same learning curve issues people commonly pin on Haskell. Rust has plenty of libraries with weird, excessively "clever" APIs, weird experimental language features, a complicated metaprogramming facility, and so on. Personally, I have found lifetimes in Rust more annoying to deal with in semi-nontrivial situations than anything I ever encountered in Haskell, and it doesn't help that things that seem like they should work often don't.

(I always figure that's the language telling me that I should use a different memory management strategy, and I generally follow its advice, but I digress.)

This is very much my opinion, but I'd attribute Rust's success over Haskell to three main points:

* Functional vs. imperative, skill curves. Rust is still vastly more familiar to most programmers at a first impression, and IMO it also has a lower skill floor.

* Rust's tooling feels a lot more modern and streamlined. `cargo` is a joy to use. Maybe Haskell's ecosystem has improved, but back when I was actively using it, it was clearly inferior to Rust's. For me, this manifested mainly in significantly greater difficulties managing dependencies and reproducing builds. This stuff is a first-class priority for the Rust team, and it shows.

* Somewhat related to the last point, Rust is "cool". It isn't burdened by decades of academic cruft; it just feels approachable, modern, and relevant in a way Haskell doesn't.

The last two points aren't really Haskell's fault. I think the Rust team has done an absolutely top-tier job of making the language approachable and usable, obviously building on lessons of the past (including Haskell, Stack, cabal, haddock, etc.) and I'd almost say it's succeeded despite the essential nature of the Rust language itself.

Re:Dhall: A Gateway Drug to Haskell by jpgvm on Tuesday June 07, 2022 @11:23PM (#31662823)
The difference is actually much more simple. Rust fills a gap, Haskell does not.

Being purely functional seems like a massive win until you realize most of the real world benefit of that expresses itself as testability/correctness which can be obtained by other means. Lazy evaluation is actually a double edged sword so it's not a clear win either.

Rust on the other hand is adding safety and correctness assurance specifically without or with very little runtime overhead while providing very predictable performance (both in runtime and space).

You can sub Haskell out for Clojure/Scala/OCaml and arguably mixed paradigm languages like Kotlin/Rust/Swift and be fairly happy.

However if the constraints of your problem call for Rust then your only other real options are to sacrifice correctness/data safety and use C/C++ instead.

FWIW I think Haskell is awesome, this is just why I think we don't see it in "the real world' much.

Re:Dhall: A Gateway Drug to Haskell by caconym_ on Wednesday June 08, 2022 @12:45AM (#31663316)
For me the real selling point of Haskell is that it's vastly more powerful and ergonomic for solving certain kinds of problems, in ways other functional languages don't necessarily share. First-class currying, typeclasses, HKTs, do-notation and other features in that vein give Haskell code a level of effortless composability whose equal I haven't seen anywhere else, and the way pattern matching is built into every part of the language makes other languages' versions of it feel clumsy and primitive.

Back when I was fluent in it, I wouldn't reach for Haskell for functional purity or lazy evaluation---I'd reach for it because I wanted the richness and flexibility of its type system and pattern matching for building and manipulating a tricky data model, or because I was doing something involving tree-like linked structures and/or that lent itself well to recursion. Parsers are the obvious example, but they are a very narrow view of what Haskell excels at.

(In short, I'd reach for it for reasons that are basically impossible to explain to somebody who doesn't already know what I'm talking about.)

I can't be so effusive about Rust. It's a really great language with a thoughtful and restrained design, powerful and practical and flexible, but I would actually say the opposite re: filling gaps: Rust feels like more of an iterative improvement in the space occupied by C/C++/Go/etc., while Haskell is transcendently good for those classes of problem where it excels.

---

Today I'm more or less fluent in Rust after a few hours' warm-up, but it would take me days or weeks to warm up my Haskell. Why? Mostly because I've largely stopped programming for fun, and I use nothing like Haskell at work. Throw in the quality of Rust's tooling and the largely effortless reproducibility of its builds (great for warming up a 6+ month old project), and it's just a far more practical choice for the little hobby programming I do. Hence my earlier comment. But I still contend that Haskell has vast untapped potential, locked away behind an intractable adoption barrier. It's less that it has nothing new or useful to offer us, and more that we are unwilling to pay the price of admission.

Re:Dhall: A Gateway Drug to Haskell by ParetoOptimal on Wednesday June 08, 2022 @12:13AM (#31663107)
> Being purely functional seems like a massive win until you realize most of the real world benefit of that expresses itself as testability/correctness which can be obtained by other means.

Is the end result reached by other means the same? Can you give an example of a competing approach in a non-pure language that gives one Haskell's advantages?

Re:Dhall: A Gateway Drug to Haskell by jpgvm on Wednesday June 08, 2022 @12:16AM (#31663122)
I don't think the result is the same but it is comparable. I would say using any language with a reasonable type system, say Kotlin w/property based testing gets you a result that while not as good as Haskell w/quickcheck is "good enough" for practical use in production software.

There is maybe some niches where that wouldn't be the case like very high assurance software where instead of Haskell you might choose say ADA instead but I'm not really familiar with those domains.

Re:Dhall: A Gateway Drug to Haskell by ParetoOptimal on Wednesday June 08, 2022 @03:01AM (#31664227)
I actually think the construction method of and composition that aids code re-use very applicable to regular-degular workaday programming.

Kotlin plus property testing gets you very far and the industry defaulting to that would be a huge improvement.

I'll have to rewrite one of my Haskell projects in Kotlin and see if I feel anything is missing.

Re:Dhall: A Gateway Drug to Haskell by jpgvm on Wednesday June 08, 2022 @05:28AM (#31665039)
That would be a pretty interesting experiment!
Re:Dhall: A Gateway Drug to Haskell by rkangel on Wednesday June 08, 2022 @05:25AM (#31665020)
Rust is doing well because it fills a usecase that has been crying out for a new solution for decades. Low level systems programming - kernels, microcontrollers, high performance applications - have basically had to be written in C or C++. Sure, under some circumstances people can get away with writing performance critical apps in other things, but you can't really write a real world OS kernel in anything else.

Rust brings a new set of tools and tricks and safety to an important use case that has had no movement for such a long time. The only real advancement has been smart pointers and "modern" C++, but while they are an improvement they also contribute to C++ being a bag of all the features.

Re:Dhall: A Gateway Drug to Haskell by robocat on Wednesday June 08, 2022 @05:08AM (#31664915)
I was keen to do a small project in Haskell. However I quickly found that the compiler gives cryptic errors. I am very capable of managing that (I have many years experience using a variety of old school compilers in the past), but I have no desire to repeat yet another compiler hell experience and waste my time fighting my tools, trying to diagnose where I have misunderstandings.

I haven’t yet tried programming rust, but I have read that error management and suggestions for correction in rust are superb. That makes a world of difference for a neophyte in a programming language.

Re:Dhall: A Gateway Drug to Haskell by antupis on Wednesday June 08, 2022 @12:00AM (#31663034)
Haskell is hard language I have like tried to learn it several times and no luck. I did not have same problem with Clojure and Rust where I was productive like first day.
Re:Dhall: A Gateway Drug to Haskell by ge96 on Wednesday June 08, 2022 @03:10AM (#31664271)
Curious what method you used? I recently bought a book, I'm only learning it to port a Haskell project to C++, if I can even do that.
Re:Dhall: A Gateway Drug to Haskell by antupis on Wednesday June 08, 2022 @05:40AM (#31665110)
I have read http://learnyouahaskell.com/chapters and then start implementing something useful based on examples. This process read book x and then implement something has worked with all other languages. I think big part is that Haskell has all kinda custom operators which are basically ungooglable.
Re:Dhall: A Gateway Drug to Haskell by bitmapper on Wednesday June 08, 2022 @09:09AM (#31666730)
https://hoogle.haskell.org/ can be helpful for this
Re:Dhall: A Gateway Drug to Haskell by Iceland_jack on Wednesday June 08, 2022 @11:45AM (#31669096)
Most people require several attempts before they get over the hump
Re:Dhall: A Gateway Drug to Haskell by ParetoOptimal on Wednesday June 08, 2022 @12:03AM (#31663049)
> asking businesses to accept that overhead and/or a vastly reduced hiring pool) is just too large of an ask for whatever marginal gain you might expect from using a "superior" programming language.

I feel the burden of proof for the claim "superior languages make only marginal differences" is one that is very high and one you have not met.

Re:Dhall: A Gateway Drug to Haskell by caconym_ on Wednesday June 08, 2022 @12:59AM (#31663412)
That's probably why I put 'superior' in "air quotes".

The null hypothesis would be that all reasonably well supported modern general-purpose programming languages are about as productive as each other on average. I have my own anecdotal opinion(s)^[1], but the onus is really on anybody claiming language X is superior (no air quotes there) to prove it to the rest of us.

In this case, by using air quotes, I meant to draw attention to the fact that the aforementioned proposition regarding Haskell's superiority is (AFAIK) unproven, as well as to illustrate the skeptical attitude a practical business leader might have toward embracing it, for what I consider to be totally fair reasons.

Also note that I'm not necessarily using 'marginal' in a pejorative sense. A marginal improvement can be significant.

^[1] Anecdotally I think Haskell is transcendently good for certain kinds of problems, and a huge pain in the ass for others.

Re:Dhall: A Gateway Drug to Haskell by ParetoOptimal on Wednesday June 08, 2022 @03:08AM (#31664258)
> In this case, by using air quotes, I meant to draw attention to the fact that the aforementioned proposition regarding Haskell's superiority is (AFAIK) unproven,

I noticed that and considered (and should have said) this to prevent any miscommunication:

I feel the burden of proof for the claim "language choice makes only marginal differences" is one that is very high and one you have not met.

Then if we want to disprove the null hypothesis there we give one programmer brainfuck and the other Python ;)

Re:Dhall: A Gateway Drug to Haskell by caconym_ on Wednesday June 08, 2022 @11:05AM (#31668416)
> Then if we want to disprove the null hypothesis there we give one programmer brainfuck and the other Python

Hence "reasonably well supported modern general-purpose programming languages".

I think this null hypothesis is where most sufficiently jaded working programmers end up, and business leaders without a programming background will start there because it's all Greek to them. I'm not here to prove its correctness, just to raise it as a very real factor working against Haskell's adoption.

Nothing would delight me more than for somebody to come along and unequivocally prove that Haskell is a silver bullet. But the point here, really, is that nobody has yet.

Re:Dhall: A Gateway Drug to Haskell by ParetoOptimal on Wednesday June 08, 2022 @03:09AM (#31664264)
> I have my own anecdotal opinion(s)^[1], but the onus is really on anybody claiming language X is superior (no air quotes there) to prove it to the rest of us.

There's also a burden of proof on those who claim there is no diffrence.

Re:Dhall: A Gateway Drug to Haskell by sudosysgen on Wednesday June 08, 2022 @10:56AM (#31668272)
No. That Language X is not the best is the null hypothesis.
Re:Dhall: A Gateway Drug to Haskell by jose_zap on Wednesday June 08, 2022 @04:10AM (#31664616)
Most of the popular languages in use today have big corporations backing them. I would say that this is a major reason why Haskell and other niche programming languages are not more widely adopted.
Re:Dhall: A Gateway Drug to Haskell by lmm on Tuesday June 07, 2022 @08:16PM (#31661674)
> Of course it's safer (and faster) than dynamic languages like Python (Ruby, JavaScript), but in my personal opinion, you don't gain that much if you compare it to something like Rust, Java or even Go.

20 years ago you would've been saying C++. Rust is closer to the Haskell of 20 years ago than it is to most languages of 20 years ago. Hell, one could make a decent argument that Java 17 is closer to the Haskell of 20 years ago than it is to the Java of 20 years ago. Even Python is feeling the need to add types (and increasingly more people are using TypeScript rather than vanilla JavaScript), even Go is feeling the need to add generics...

> In particular the common abstractions (Monad, Applicative, Functor) are used very differently in different libraries (everyone seems to want to write her own DSL), so it's hard to get comfortable with third party libraries.

This is completely backwards IME. In most languages, every new framework comes with its own abstractions that you have to learn (whether that's, IDK, Spring Beans, ActiveRecord, React Hooks, ...). Haskell-like languages where there are a few standard meta-abstractions like Monad/Applicative/Functor make it an order of magnitude easier to pick up a new framework, because they mean core abstractions work the same in every framework.

All that said, I do kind of agree with your conclusions, but I think that's more about the industry being dishonest about its priorities. IME Haskell really does deliver what it says: for less than twice the effort of something like Python, you can write software that approximately never has bugs, in the sense that it will always do what it was specified to do. But most of the industry doesn't actually care about getting rid of bugs; they'd rather have buggier software in less development time (and if that means more maintenance effort in the long term, well, who cares).

Re:Dhall: A Gateway Drug to Haskell by ParetoOptimal on Wednesday June 08, 2022 @03:12AM (#31664280)
> Haskell-like languages where there are a few standard meta-abstractions like Monad/Applicative/Functor make it an order of magnitude easier to pick up a new framework, because they mean core abstractions work the same in every framework.

Exactly! The abstractions are less leaky, more sound, and give this gift and feeling of universality, unrivaled composition, and cohesion.

Re:Dhall: A Gateway Drug to Haskell by agumonkey on Tuesday June 07, 2022 @04:36PM (#31659744)
I wonder if the first point is due to a paradox of advanced tools.. society lives around "how do you assemble teams to solve big problems", they need organization tricks more than logic/language ones. That's why RoR, go, etc win, they allow most groups to end up with something workable. Haskell and the likes are more about exploration.. not tending to companies needs for profits.

About the last point, my tiny observations is that language too advanced don't get used as dependencies.. they get ignored until the crowd matures enough to get the ideas in their own ways and pull a gene transfer.

- lisp idioms (map, filter, destruct) => all dyn langs

- react / vue .. basically let over lambda and closure based programming (I even believe vue provide/inject is near equal to dynamic variables)

wait until someone there likes to thread state or rng seeds through 'chains of functions' and you'll see monads pop up

Re:Dhall: A Gateway Drug to Haskell by armchairhacker on Tuesday June 07, 2022 @05:17PM (#31660180)
Haskell does have advanced tools though. Stack / cabal, haddock, htest can be comparable to Rust’s tooling. Haskell’s LSP is making rapid progress and there are many formatters and linters.

Tooling still has a way to go, but I don’t think that’s all. Haskell’s abstraction is just too much when you need to design something which is ultimately kind of straitforward, and most apps are (design app, game, utility app, web server, etc.)

I do think Haskell is more than a research language, it does have some use in practical, mainstream programming. In particular, Haskell is great at anything which is “input to output”, like compilers or document converters. Or in a program which is ultimately complex, and not just for optimization but “math” complexity, like math programs or simulators. In those programs the implicit laziness actually comes in handy.

But Haskell for a real-time video game or editor, and you’re just wrapping everything in an IO monad or some restricted stateful equivalent, and executing most of the instructions in sequence anyways.

Re:Dhall: A Gateway Drug to Haskell by tinco on Tuesday June 07, 2022 @05:26PM (#31660291)
Why would you wrap things in an IO monad for a real time video game? There's a whole lot of code you can do purely functionally in video games that can make it very nice.

I've done a couple small projects in Blueprint which is a purely functional programming language embedded in UnrealEngine 4 and I enjoyed it a lot. Blueprint notably does not expose any type classes, at least not when I tried it a couple years ago, but it felt very expressive for building complex game logic.

Re:Dhall: A Gateway Drug to Haskell by Arelius on Tuesday June 07, 2022 @06:44PM (#31660918)
FYI, Blueprint is very much not purely functional and has exposed type classes since it changed from Kismet IIRC.
Re:Dhall: A Gateway Drug to Haskell by tinco on Tuesday June 07, 2022 @07:22PM (#31661259)
Maybe I'm not remembering it correctly. Basically you had colored wires representing values flowing through functions, and then you had white wires that represented ordered execution, much like the IO monad. Is it possible to have side effects from nodes without the white wire?
Re:Dhall: A Gateway Drug to Haskell by kahnclusions on Wednesday June 08, 2022 @04:04AM (#31664582)
> Stack / cabal, haddock, htest can be comparable to Rust’s tooling.

Disagree from me. I spent a year writing Haskell professionally, and from my own personal experience Haskell's tooling was overly complicated and difficult to use.

Maybe my impression is totally wrong or outdated, and it's surely not applicable to the whole community, so I'm sorry if this is a little out of touch now, but I sometimes got the sense that Haskell's community just doesn't care about the developer experience. They hold to this false dichotomy that if you make tools easy to use, then you can't have advanced features. Or simply, Cabal works just fine the way it is, why do we need Stack? Why would you need more than one GHC installation on a machine? Holy wars on the mailing lists re: Stack, Cabal, Haskell Platform. And if someone tells me to "just use Nix" one more time I will cry...

Rust feels like a breath of fresh air. The community seriously cares about their developer experience both for newbies and experienced professionals, and it really feels like a lot of work has gone into making the tools and documentation accessible and useful.

Re:Dhall: A Gateway Drug to Haskell by Zababa on Wednesday June 08, 2022 @03:27AM (#31664366)
> Stack / cabal, haddock, htest can be comparable to Rust’s tooling.

I don't think they are. Having used both, Rust's tooling is more accessible to beginners, which makes a big difference. I find it even easier to use than npm, while I find Haskell's tooling harder (on roughly the same level as OCaml with dune, or Maven).

> Haskell’s LSP is making rapid progress and there are many formatters and linters.

Haskell's LSP is good, however it's not as good as rust-analyzer, and has a habit of chewing through a lot of RAM.

Re:Dhall: A Gateway Drug to Haskell by rileyphone on Tuesday June 07, 2022 @08:28PM (#31661743)
The "fungible programmer" theory [0] is one of the better explanations for the unpopularity of languages like Haskell and Lisp. Ultimately, making software that's large enough will become an organizational problem as well as technical one, and developers will get funged into being blub programmers [1], though RoR is a pretty nice way to do that all things considered. I would argue Go was designed for maximum fungibility.

[0] http://www.loper-os.org/?p=69

[1] http://www.paulgraham.com/avg.html

Re:Dhall: A Gateway Drug to Haskell by Karrot_Kream on Tuesday June 07, 2022 @09:21PM (#31662158)
Lol the fungible programmer theory is one of the most disrespectful theories of programmer choice out there. It assumes that, by default, everyone is a bad programmer and that only people that use "non-blub languages" are good programmers. Blub itself is vaguely defined or generally never defined rigorously. I never find a theory that has contempt for so much of an industry has any real explanatory benefit.
Re:Dhall: A Gateway Drug to Haskell by rileyphone on Tuesday June 07, 2022 @11:32PM (#31662881)
It's not necessarily that they are worse programmers, but rather represent the industrialization of building software, as outlined by Brad Cox [0]. Partially driving this is the shorter tenure of today's software engineers. How many beautiful things have had to be completely rewritten because the original creator had left, and no one could grok it? Not that there is no way to reconcile fungibility with expressiveness and beauty, but the tradeoffs involved are tricky and will always end up disappointing somebody.

[0] https://www.researchgate.net/publication/3246772_Planning_th...

Re:Dhall: A Gateway Drug to Haskell by astrange on Tuesday June 07, 2022 @10:58PM (#31662675)
It's largely a demonstration that if you give pg an incredible amount of money by accidentally inventing online stores, he will develop an incredible ego and decide it was all due to his personal technical brilliance.
Re:Dhall: A Gateway Drug to Haskell by nine_k on Tuesday June 07, 2022 @05:42PM (#31660412)
We already sort of see threading state through chains of (pure) functions; it's how you write React, especially if you use Redux instead of hooks. You lug props around, they are explicitly immutable because you always get a copy, and it's fine, nobody complains much. It feels logical.

Some more effort in packaging this ergonomically, and we'll see purity annotations in TS and explicit passage of state objects around.

Re:Dhall: A Gateway Drug to Haskell by agumonkey on Wednesday June 08, 2022 @02:32PM (#31671989)
redux is another part of the 'gene transfer idea', nobody used reducers for anything except maybe rich hickey
Re:Dhall: A Gateway Drug to Haskell by Karrot_Kream on Tuesday June 07, 2022 @05:23PM (#31660245)
> I wonder if the first point is due to a paradox of advanced tools.. society lives around "how do you assemble teams to solve big problems", they need organization tricks more than logic/language ones. That's why RoR, go, etc win, they allow most groups to end up with something workable. Haskell and the likes are more about exploration.. not tending to companies needs for profits.

I feel like "not tending to companies needs for profits" is a way to elevate Haskell and monadic FP abstractions with appeal to conspiracy/(postmodern) ideology. I don't mean this to be a pro-or-anti capitalism sentiment, but the excuse here is that "in a more just/less captalist/<other> world, Haskell would be a great tool, but our flawed world makes it not so" and I disagree with that. I just don't think Haskell is that good of a tool regardless (and I see the Haskell community these days appealing to this take a lot, trying to blame anyone but themselves.)

I think that people genuinely don't derive much value from Haskell and monadic FP. My experience, having written and maintained non-production-grade Haskell code, has been that the community is obsessed with toys and small examples, derives a lot of pleasure from clever abstractions which don't materially affect development (like Lenses), and most importantly doesn't really care about shipping software. There's exceptions like SPJ and Joey Hess who definitely ship useful Haskell, but the community doesn't care nearly enough about making it easy to actually produce software that a non-Haskell enthusiast would care about using.

Libraries are often created for a Masters project and abandoned. Even if a library works, debugging edge cases is never thought of. Almost nothing is written about testing in Haskell. No two libraries can agree on which monad stack to use, so a non-trivial amount of integration code involves matching and lifting into other monads (nor the performance implications of doing all of this matching and lifting). There are very few examples of organizational patterns for Haskell codebases for folks trying to create a project other than GHC itself, Pandoc, and perhaps XMonad. The community loves talking about abstractions and unifying concepts but doesn't really seem to have any practical tips about writing software. The string types in the language are confusing and poorly differentiated. The cabal and stack split is confusing and makes no sense to outsiders. The weird cargo-cult obsession in the community about category theory from people with little formal mathematical knowledge is bizarre. I can go on and on, but I don't want to dunk on the language endlessly (and I can certainly do this to any language I've used in love or anger :)

Fundamentally I don't think Haskell offers the programmer much more than what you'd get out of a language like Rust, Java, or Go (yes even Go) as the GP said. It's a language with a lot of interesting concepts that's fun for folks who like to solve algebra problems and is certainly a clean introduction to monadic FP. I'm looking forward to a successor that takes its concepts, cleans them up, and offers a way to write actual software with them. Then again, Multicore Ocaml is landing soon...

Re:Dhall: A Gateway Drug to Haskell by pyrale on Tuesday June 07, 2022 @07:40PM (#31661402)
Several of the issues you talk about are true enough, especially the ones about the community not making it easier for newcomers to get the ropes.

The reason for that is that people who do haskell for a living are dwarfed by the hobbyist community which makes them invisible, and they're spread thin on maintaining the ecosystem. GHC, HLS and all the other good things there are are the work of people on their free time, while other, more successful languages simply have companies dedicating time, money and contracts to tooling.

All of that means that it's not easy to move from the hobbyist haskeller group to the paid haskeller group. Most people usually get there by getting hired in a place where the stack, library choices, etc. are made by people who had done haskell professionally before and have solved the problem you cite for the team.

Once you're in, the benefits of Haskell are tangible, otherwise people would stop using it, and there wouldn't be a professional community. That is not to say that there are no problems, it's just that they are different problems, and people that stick to haskell for their job usually do it as a tradeoff.

Re:Dhall: A Gateway Drug to Haskell by Karrot_Kream on Tuesday June 07, 2022 @08:40PM (#31661844)
What are the problems y'all see in production then with Haskell code? I'm curious since I never ran my code in a prod setting so I don't know what one cares about when operating Haskell code.
Re:Dhall: A Gateway Drug to Haskell by pyrale on Wednesday June 08, 2022 @02:56AM (#31664201)
Honestly, the problems I had with Haskell were mostly related to organization rather than tech. How recruitment would happen. What rules we would set in place to make sure the codebase didn't become overcomplicated. How to make sure people don't get engrossed in tech and neglect the business aspect. How to make sure a large part of the codebase is mundane enough that newcomers can contribute on it quickly.

The tech itself really works well, but it required either an org mature enough to do the things correctly, or a shop purely focused on haskell that would accept the complexity.

Also, sometimes the library ecosystem is a bit lacking. It wasn't an immovable roadblock, but we did write stuff that may have been available as a lib in other languages. This was a minor impediment for us, but it can get bad in other contexts.

Re:Dhall: A Gateway Drug to Haskell by unhammer on Wednesday June 08, 2022 @02:36AM (#31664066)
That would be a nice "ask hn" :-)
Re:Dhall: A Gateway Drug to Haskell by ParetoOptimal on Wednesday June 08, 2022 @02:48AM (#31664142)
> Most people usually get there by getting hired in a place where the stack, library choices, etc. are made by people who had done haskell professionally before and have solved the problem you cite for the team.

That's very true and the case at my job. We've taught people with 0 Haskell experience to write useful production code in under a month.

Re:Dhall: A Gateway Drug to Haskell by ParetoOptimal on Wednesday June 08, 2022 @02:44AM (#31664113)
This comment has a lot of facts wrong.

> Even if a library works, debugging edge cases is never thought of.

Many libraries use sum types to express their api which naturally leads one to consider edge cases.

> Almost nothing is written about testing in Haskell.

Yes there is! Did you verify your claim with a quick search? Here's what one gave me:

- https://mmhaskell.com/testing/test-driven-development

- https://jaspervdj.be/posts/2015-03-13-practical-testing-in-h...

Heck, here's one from 2007:

https://www.jasani.org/posts/2007/unit-testing-with-hunit-in...

It feels like this web of lies about Haskeller's not caring about real world concerns is being spun, but even with minimal effort that is trivial to disprove.

> No two libraries can agree on which monad stack to use,

The mtl library is the most used monad stack by far and it's not typical to see others very often.

> so a non-trivial amount of integration code involves matching and lifting into other monads (nor the performance implications of doing all of this matching and lifting).

I feel this may betray a lack of understanding because lifting between monad stacks is expected.

I agree there are performance implications on theory, but if you get out of the performance ivory tower you'll find it doesn't happen much in the real world ;)

Re:Dhall: A Gateway Drug to Haskell by ParetoOptimal on Wednesday June 08, 2022 @02:33AM (#31664045)
> derives a lot of pleasure from clever abstractions which don't materially affect development (like Lenses),

Oh but they do materially affect development in the same type of way LINQ does for C# programmers.

Re:Dhall: A Gateway Drug to Haskell by ParetoOptimal on Wednesday June 08, 2022 @11:07AM (#31668429)
Good examples in "Putting lenses to work" by John Weigley:

https://youtube.com/watch?v=QZy4Yml3LTY

Then for a great book that gives a great understanding see Chris Penner's amazing and fun "Optics by example:

https://leanpub.com/optics-by-example

Re:Dhall: A Gateway Drug to Haskell by sfvisser on Tuesday June 07, 2022 @04:59PM (#31659988)
> In particular the common abstractions (Monad, Applicative, Functor) are used very differently in different libraries (everyone seems to want to write her own DSL), so it's hard to get comfortable with third party libraries.

I don’t see how this is true. These common abstraction make reading code incredibly easy most of the time. Many Haskell libraries are based on compositional building blocks. Seeing a monoid, functor or monad instance gets you 90% there in understanding the usage. It’s really the superpower of Haskell that I miss (and badly reimplement) in every other PL.

Re:Dhall: A Gateway Drug to Haskell by smegma2 on Wednesday June 08, 2022 @12:05AM (#31663054)
I was also wondering about this. I can't think of an example of a library implementing Functor in a surprising way, or in a way that somehow differs from another library.
Re:Dhall: A Gateway Drug to Haskell by ParetoOptimal on Wednesday June 08, 2022 @03:14AM (#31664290)
Exactly! And free theorems and polymorphism means even more things work as someone that understands the core abstractions would expect them to.
Re:Dhall: A Gateway Drug to Haskell by feanaro on Tuesday June 07, 2022 @06:37PM (#31660883)
Completely agreed, but I guess this just doesn't click with some people as well as it did with me (empirically).
Re:Dhall: A Gateway Drug to Haskell by pyrale on Tuesday June 07, 2022 @07:19PM (#31661238)
> In my opinion Haskell's capabilities to help implement general-purpose SW (services, compilers, GUI, game-dev, systems) are way over-hyped.

Haskell usage in companies is currently niche at best. It's hard to know what you would consider reasonable use of the language if you believe it's currently overhyped. Maybe your idea of hype relies on conference talks or some other metric I don't get?

> in my personal opinion, you don't gain that much if you compare it to something like Rust, Java or even Go.

Rust is pretty similar to Haskell in terms of type system experience, the main difference being that, when you don't really care about how memory is used, Rust forces you to handle it. Any GC'd language will feel refreshing if you're annoyed by that. Aside from that, I don't challenge that Rust is a great language to program in.

Java's usability is built on a fundamentally different model: it benefits from decades of investment in IDEs, and all professional java users I know use it extensively. While a haskeller will rely on types to perform refactoring, a java dev will refactor using the IDE, with an equivalent peace of mind. Java's typesystem is poor, but it doesn't really matter in users' development experience.

I don't have much positive stuff to say about Go, and even less about its typesystem. You may find better advocates for this one.

> Lastly it's just incredible hard to estimate runtime characteristics

Most use cases don't care about that. You quoted Java earlier, a language in which most devs never ever really delve into runtime performance and simply let the runtime do its stuff. As it turns out, it's usually good enough.

It's quite surprising that aside from Fortran, C derivatives and Rust, no one gives a damn about performance, but when it's haskell, it suddenly becomes a problem.

> If Haskell is such an advanced language to make implementing reliable SW such a breeze

Is that some kind of strawman where if haskell doesn't deliver on being touted as the gift of God to programmers, then it's bad?

Re:Dhall: A Gateway Drug to Haskell by picozeta on Tuesday June 07, 2022 @07:30PM (#31661318)
> [...] Maybe your idea of hype relies on conference talks or some other metric I don't get?

Yes, I'm referring to programmer circle related social networks (HN, r/programming, ...).

> It's quite surprising that aside from Fortran, C derivatives and Rust, no one gives a damn about performance, but when it's haskell, it suddenly becomes a problem.

Because performance problems are particularly hard to solve in Haskell due to its high level of abstraction.

> Is that some kind of strawman where if haskell doesn't deliver on being touted as the gift of God to programmers, then it's bad?

Yes, given the fact that it's praised to such a high degree, users might have extremely high expectations, but are likely to be underwhelmed if it does not solve their problems in a vastly superior way.

Re:Dhall: A Gateway Drug to Haskell by jose_zap on Wednesday June 08, 2022 @03:32AM (#31664396)
> Because performance problems are particularly hard to solve in Haskell due to its high level of abstraction.

Does not match my experience. Haskell typically compiles to quite performant code, at least for all the cases that I’ve used it for.

Then few times I had to optimize anything for performance, it did not feel different than other languages. It was in almost every case about the architecture of the code and not something to do with the language itself.

Re:Dhall: A Gateway Drug to Haskell by pyrale on Tuesday June 07, 2022 @07:52PM (#31661500)
> Yes, I'm referring to programmer circle related social networks (HN, r/programming, ...).

> Yes, given the fact that it's praised to such a high degree, users might have extremely high expectations

May I suggest the problem is not with the language, then? As a fellow HNer that you can trust, I also have an extremely well-made bridge to sell you if you're interested.

> Because performance problems are particularly hard to solve in Haskell due to its high level of abstraction.

That doesn't match with my experience using the language. But again, how often do you have to solve performance issues that are more complex than a misplaced quadratic function in other languages? If it's frequent enough, wouldn't you consider using a language like rust or CPP rather than something like Java, Go or Python?

Re:Dhall: A Gateway Drug to Haskell by Karrot_Kream on Tuesday June 07, 2022 @09:15PM (#31662102)
> But again, how often do you have to solve performance issues that are more complex than a misplaced quadratic function in other languages? If it's frequent enough, wouldn't you consider using a language like rust or CPP rather than something like Java, Go or Python?

Why? This doesn't agree with my experience using Java or Go at all. Both languages have ways to reuse objects that significantly decrease GC pressure for bottlenecks to achieve competitive performance. Also anyone running net services at scale frequently runs into performance issues that are much more thorny than misplaced quadratic functions (are you deserializing JSON in a hot loop? is your HTTP connection pool too large? is your hash table too large, leading to significant collisions?)

Rust or C++ is overkill when reusing some objects, moving data structures, or memoizing some serde is all you need. Reasoning about them in Haskell can also be quite difficult, especially if you build a lazy chain of operations that leads to executing an expensive operation frequently in a hot loop, or forget to preallocate HTTP connections in a pool, or something like that. It's a high cost to pay for a better type system and awkwardly unifying abstractions.

Re:Dhall: A Gateway Drug to Haskell by pyrale on Wednesday June 08, 2022 @08:55AM (#31666558)
> Both languages have ways to reuse objects that significantly decrease GC pressure for bottlenecks to achieve competitive performance.

I agree with that, but the consequence of these things is that developers don't have to care about it themselves. Thus these languages are usually good enough that optimization is not a concern for most devs in these ecosystems.

> (are you deserializing JSON in a hot loop? is your HTTP connection pool too large? is your hash table too large, leading to significant collisions?)

None of these things are language-related, though.

> Reasoning about them in Haskell can also be quite difficult

We didn't have specific trouble when this kind of problem came up, maybe your mileage is different ? Being used to it, it's kind of hard to understand what specifically you find hard in this.

Re:Dhall: A Gateway Drug to Haskell by picozeta on Tuesday June 07, 2022 @07:58PM (#31661562)
Yes, if performance is the main concern, Rust looks good. However if I can get by with GC I still would choose something like Go, as I am just getting to a working solution faster.

And I spent way less time learning Go than learning Haskell.

Re:Dhall: A Gateway Drug to Haskell by pyrale on Tuesday June 07, 2022 @08:23PM (#31661717)
> And I spent way less time learning Go than learning Haskell.

...And you've got what you paid for.

Re:Dhall: A Gateway Drug to Haskell by astrange on Tuesday June 07, 2022 @11:01PM (#31662689)
Google paid quite a lot internally to develop Go, and despite its many flaws it at least has mechanical sympathy for the computers it runs on.

I've read GHC assembly and it seems to be intentionally trying to run poorly - eg it calls everything through unpredictable function pointers. No, this isn't CPUs' fault, as GHC people do try to be optimal, they are just failing. jhc produced good code but isn't maintained afaik.

Re:Dhall: A Gateway Drug to Haskell by andi999 on Wednesday June 08, 2022 @04:46AM (#31664797)
Maybe Haskell is overpriced?
Re:Dhall: A Gateway Drug to Haskell by pyrale on Wednesday June 08, 2022 @08:44AM (#31666423)
In terms of learning, Haskell is like a lootbox game. You can definitely do great things with a minimal budget, but people get addicted and end up spending fortunes on additional content ;)
Re:Dhall: A Gateway Drug to Haskell by 1vuio0pswjnm7 on Tuesday June 07, 2022 @09:49PM (#31662313)
What about pandoc. https://en.wikipedia.org/wiki/Pandoc

Author is not a "dev" nor a self-proclaimed "engineer". He has no computer science, maths, EE or physics degrees listed on his CV. He does list several languages. None are computer languages. He suggests the programs he has written may be "structured procrastination".

http://johnmacfarlane.net/macfarlane-cv.html

https://www.johnmacfarlane.net/BayHac2014/

https://usesthis.com/interviews/john.macfarlane/

I think Dhall looks interesting. Like MacFarlane, I am free to choose any language I find satisfying for procrastination purposes.

Re:Dhall: A Gateway Drug to Haskell by ParetoOptimal on Wednesday June 08, 2022 @03:17AM (#31664305)
> Author is not a "dev" nor a self-proclaimed "engineer". He has no computer science, maths, EE or physics degrees listed on his CV. He does list several languages.

To piggy-back on this I'm a professional Haskell programmer with no degree and my math education stopped at shaky pre-calculus.

Re:Dhall: A Gateway Drug to Haskell by bitmapper on Wednesday June 08, 2022 @06:51AM (#31665521)
I don't really think many people are calling it a panacea. From my experience in the community most people I know who write Haskell write it for productivity reasons (including me, I'd rather be using Idris 2 with algebraic effects though.)

I'm not saying it's somehow magically more productive than other languages, because it's useless to throw around stuff you can't really prove like that, just some people find it to be the case.

I've never found "everyone writing their own DSL" to be problematic, because it's all exposed through the Monad/Applicative/Functor classes, so the way you use them are all very similar. Honestly, the usage of such eDSLs is one of my favourite parts of writing Haskell.

I use Haskell at my work for our main application, and we've been looking at adopting a style guide like https://kowainik.github.io/posts/2019-02-06-style-guide

And about interesting applications in Haskell, I'd consider https://hasura.io/ pretty interesting!

EDIT: And about language extensions, yeah, they can be a problem. What we do is settle on a base set of extensions, and if you want to use another one, you need to provide sufficient justification for it.

Re:Dhall: A Gateway Drug to Haskell by whateveracct on Tuesday June 07, 2022 @10:30PM (#31662531)
> In particular the common abstractions (Monad, Applicative, Functor) are used very differently in different libraries (everyone seems to want to write her own DSL), so it's hard to get comfortable with third party libraries.

This is the opposite of my experience as a professional of many years. Most Haskellers I know think that this thing you're complaining about is extremely helpful, actually.

The fact that every library gives you shared instances for wildly different things makes them easier to use. If you give me an Applicative instance, I'll be able to use it in so many ways.

It's a shared abstraction language. No other PL compares.

At the end of the day, none of the languages you mention come close to being able build complicated programs out of smaller ones like Haskell can. It's all gunk, inherently.

I use my brain to write all those languages in an exhausting way. I barely do hard thinking with Haskell ever. Whether it be gamedev, web services, parsers .. I thank god every day I don't have to live like a normal programmer. My mind would be so tired.

Re:Dhall: A Gateway Drug to Haskell by ParetoOptimal on Wednesday June 08, 2022 @03:22AM (#31664329)
> I use my brain to write all those languages in an exhausting way. I barely do hard thinking with Haskell ever. Whether it be gamedev, web services, parsers .. I thank god every day I don't have to live like a normal programmer. My mind would be so tired.

I feel this. On slower days where I manage to eek out good productivity I joke that Haskell is the secret weapon of dumb and lazy people that managed to somehow not be lazy learning Haskell.

Re:Dhall: A Gateway Drug to Haskell by whateveracct on Wednesday June 08, 2022 @07:42PM (#31675914)
I like it for side projects for the same reason. It feels like you're always making progress even when you can't find time or energy. I have made a lot of progress on my indie game while doing the dishes because Haskell is so easy to do in your subconscious.
Re:Dhall: A Gateway Drug to Haskell by bigDinosaur on Tuesday June 07, 2022 @09:20PM (#31662146)
I still think Elm is a better example for reliable (web) software development. I've simply never had a similar experience in terms of the high amount of type safety enforced by the compiler. Interestingly I found I was much less fatigued after programming in it (and this applies for Haskell too) because the problems one has to solve aren't really stupid ones.

(I don't recommend it for production only because it has been partially abandoned, it seems, but it if hadn't been and the community had kept growing it would have been awesome).

I don't think your snarky section is that relevant, because it's hardly like the best technology wins. Software engineering has a bias towards either irrelevant nonsense to pad resumes or extreme conservatism.

Re:Dhall: A Gateway Drug to Haskell by palerdot on Wednesday June 08, 2022 @11:58AM (#31669309)
> I don't recommend it for production only because it has been partially abandoned

Why do you say that?

Sure, there were some dramas around how the language/ecosystem should evolve and almost all external opinions are not considered. But again, you could argue that Elm is consistent because of this heavy handed approach to language design. I'm just wondering why you would consider it as `partially abandoned`.

Re:Dhall: A Gateway Drug to Haskell by bigDinosaur on Thursday June 09, 2022 @12:41AM (#31677620)
Too many high profile community members basically saying that it's impossible to work with the core team on improvements, with no clear communication that there even is a core team left any more, and bugs in the standard library/compiler that haven't gone fixed despite being one line changes. Many, many pull requests with such fixes have gone ignored for 3+ years. No indication of any possibility for a superior FFI or at least a path forward for the evolution of the current one.

The language itself is still mostly fine, so long as you don't run into its limitations. I still wouldn't recommend it going forward for the above reasons, though. Too many warning signs and contributor goodwill unnecessarily burnt. Evan is a perfectionist and clearly has no interest in developing a feature if he can't see the use case for it (his response to negative numbers in case..of expressions was a classic example).

Personally I think it's all a bit of a shame, Elm is one of my favourite things ever in web development. I really, really wanted/want it or something similar to succeed in terms of major projects being written in it.

Re:Dhall: A Gateway Drug to Haskell by palerdot on Thursday June 09, 2022 @10:49AM (#31681887)
Maybe check out Mint - https://mint-lang.com/

This is an effort that takes best ideas from Elm. AFAIK, the creator was one of the high profile community members (or atleast a prolific Elm user).

I'm not sure how this language will pan out. There are too much options for UI development right now. Also, last when I checked, you have to buy in on this framework/lang completely and you had no option of plugging this in an existing project.

Still, I think Elm users may find this interesting.

Re:Dhall: A Gateway Drug to Haskell by rbn3 on Tuesday June 07, 2022 @05:53PM (#31660512)
>Furthermore it's still the case, that there's not much really interesting SW made in it.

TidalCycles would like to have a word with you. Easily one of the most interesting and unusual pieces of SW that currently exists.

Re:Dhall: A Gateway Drug to Haskell by eggy on Tuesday June 07, 2022 @06:34PM (#31660856)
I played with Tidal when it first came out for music. I do like it. To me though, I prefer Grace[1] (CM, Lisp) and Extempore[2] (Scheme, xtlang). You can work within the grammar of music, or you can program your own DSPs. Xtlang in Extempore is a pretty neat DSL created by Andrew Sorensen. To me Tidal was mainly rhythm-based. I am sure it has evolved since then, but it felt like a coding sequencer or pattern generator. I liked Sporth, (Soundpipe + Forth), but it appears something has occurred on the internets that I am not aware of. The repo is still here[3], but it is not being worked on any longer from what I have read there.

If interesting and unusual is your thing for generative music, check out Orca[4]. That has eaten hours of my time far more than Tidal for me.

[1] http://commonmusic.sourceforge.net/

[2] https://extemporelang.github.io/

[3] https://git.sr.ht/~pbatch/soundpipe

[4] https://100r.co/site/orca.html

Re:Dhall: A Gateway Drug to Haskell by sa46 on Tuesday June 07, 2022 @04:47PM (#31659864)
Dan Luu has a take on this: http://danluu.com/butler-lampson-1999/
Re:Dhall: A Gateway Drug to Haskell by mastazi on Tuesday June 07, 2022 @05:05PM (#31660056)
Interesting take but I find the RISC argument to be completely flawed in light of ARM/M1.

Even accepting the distinction (which I don't agree with) between "non RISC-y" ARM (v7 and earlier) and "RISC-y" (v8 and later), Apple M1 is "RISC-y" by that definition (instruction set ARMv8.5A)[1]. And it's doing well.

[1] Line 256 https://github.com/llvm/llvm-project/blob/main/llvm/include/...

Re:Dhall: A Gateway Drug to Haskell by klelatti on Tuesday June 07, 2022 @05:45PM (#31660429)
It’s a really odd take given that by 2015 Apple was already on Arm v8 for the iPhone and the performance gains over v7 were clear. Calling it ‘hopeless’ seems incredibly wide of the mark.
Re:Dhall: A Gateway Drug to Haskell by astrange on Tuesday June 07, 2022 @11:02PM (#31662697)
ARMv8 is a well designed architecture that I don't think is "RISC" because eg it has some complex addressing modes, SIMD, and other good ideas.

It is more RISC than ARMv7 was. And I think if it was targeting smaller CPUs with less wide decoders, being more x86-like ("CISC") and having variable length instructions would be better.

Re:Dhall: A Gateway Drug to Haskell by picozeta on Tuesday June 07, 2022 @05:04PM (#31660043)
Thanks, interesting article.
Re:Dhall: A Gateway Drug to Haskell by lopatin on Tuesday June 07, 2022 @04:54PM (#31659925)
Thoughts and prayers to all the people whose heads just exploded by reading that Haskell doesn't gain you that much compared to Go. (I tend to agree)
Re:Dhall: A Gateway Drug to Haskell by sidkshatriya on Tuesday June 07, 2022 @05:18PM (#31660186)
> Sure, it's nice to implement parsers/compilers in it (see Nix, Elm, DHall) [...]

Nix is implemented in C++, not Haskell

Re:Dhall: A Gateway Drug to Haskell by picozeta on Tuesday June 07, 2022 @05:26PM (#31660281)
Oh, I thought it was Haskell. Thanks, fixed.
Re:Dhall: A Gateway Drug to Haskell by skavi on Tuesday June 07, 2022 @05:22PM (#31660242)
> functional programming is part of CS curricula for at least 10 to 20 years now

My school (UIUC) only just added a functional programming course to the CS course map in 2021. Of course you could always take a functional programming course if you wanted to, but not many do.

Re:Dhall: A Gateway Drug to Haskell by lopatin on Tuesday June 07, 2022 @05:32PM (#31660344)
Interesting. I graduated a decade ago and remember taking CS421 where you implement part of an OCaml compiler in OCaml. I thought that it was required because I don't think I would have chosen it myself. It ended up being my favorite course in all of school.
Re:Dhall: A Gateway Drug to Haskell by skavi on Tuesday June 07, 2022 @08:41PM (#31661850)
Re:Dhall: A Gateway Drug to Haskell by ParetoOptimal on Wednesday June 08, 2022 @12:01AM (#31663038)
> Lastly it's just incredible hard to estimate runtime characteristics (clock-time, memory usage), because you never know which compiler optimizations kick in or not.

When you use it as a faster safer Python this almost never matters in the real world.

Re:Dhall: A Gateway Drug to Haskell by rowanG077 on Tuesday June 07, 2022 @04:24PM (#31659647)
I only agree with the runtime characteristics point. It's very hard to get an idea of what is efficient or not sometimes. But on every other point I believe Haskell is magnitudes better for general software development then mainstream languages.
Re:Dhall: A Gateway Drug to Haskell by picozeta on Tuesday June 07, 2022 @04:27PM (#31659676)
That's my point (sry I edited my post, when you already replied).

It's a good programming languages, but being "magnitudes better" is absolutely not true in my experience.

Re:Dhall: A Gateway Drug to Haskell by amelius on Tuesday June 07, 2022 @05:00PM (#31659990)
Perhaps the ideal language is then a combination of two approaches: Haskell in the outer loops, Rust in the inner loops?
Re:Dhall: A Gateway Drug to Haskell by marcosdumay on Tuesday June 07, 2022 @05:52PM (#31660492)
The Python code using C libraries you get on machine learning is a nice model. There is no reason why you can't recreate it with Haskell + Rust.

But it has one drawback that it's relatively slow to pack stuff to send between languages. On Python everything is so slow that this doesn't make much of a difference, but on the Haskell + Rust scenario you will want much larger library blocks.

Re:Dhall: A Gateway Drug to Haskell by pyrale on Tuesday June 07, 2022 @08:02PM (#31661590)
You will lose the benefits of both type systems if you try to combine them. Rust doesn't really track effects, while Haskell doesn't care about memory.
Re:Dhall: A Gateway Drug to Haskell by cies on Wednesday June 08, 2022 @03:58AM (#31664540)
> you don't gain that much if you compare it to something like Rust, Java or even Go.

Some languages have no implicit nullabillity and proper sum-types and exhausivity checks. This is what the main benefits of Haskell come from IMHO. Langs like Rust, Elm, OCaml/Reason/ReScript and Kotlin (even TypeScript) to some extend have this.

Go and Java dont have this, and I miss them every time I use these languages.

Re:Dhall: A Gateway Drug to Haskell by substation13 on Wednesday June 08, 2022 @05:03AM (#31664886)
The big wins from Haskell are immutability, pure functions by default, and expression-orientation... not the type-system, in my view.

As to why it's not more popular? Well the entire industry caught OOP fever during Java's heyday, so platform holders pushed languages that were similar - see JavaScript, C#, Visual C++, etc... Now this paradigm has huge inertia, and smart software engineers are able to make it work (just about) anyway. In other words, an accident of history got us caught in a local minimum.

Things are shifting though. The most popular framework in the world in probably React, and it's a (pretty crummy) implementation of functional programming concepts. It's not hard to find OOP thought-leaders advocating for immutability, effect systems and so on. Implementation inheritance is going the way of the singleton.

I agree that Haskell in particular suffers from being lazy, which has genuine problems in practice.

Re:Dhall: A Gateway Drug to Haskell by baq on Wednesday June 08, 2022 @08:27AM (#31666256)
> I agree that Haskell in particular suffers from being lazy, which has genuine problems in practice.

- tooling is (used to be) bad

- compiler is hostile to new users

- even the simplest code is nigh undebuggable

- gotchas like foldl vs foldr due to lazy evaluation

Re:Dhall: A Gateway Drug to Haskell by ParetoOptimal on Wednesday June 08, 2022 @12:00AM (#31663033)
> In particular the common abstractions (Monad, Applicative, Functor) are used very differently in different libraries (everyone seems to want to write her own DSL), so it's hard to get comfortable with third party libraries.

Can you give one example of this?

Re:Dhall: A Gateway Drug to Haskell by mbrodersen on Tuesday June 07, 2022 @11:08PM (#31662727)
I know Haskell quite well but never reach for it when programming. Languages like F# and ocaml gives me most of the benefits of functional programming without having to deal with the unpredictability of lazy evaluation and the 10 level deep pollution of a single IO call. Also, when it comes to leading edge type systems, Haskell is falling behind. Dependently Typed languages like Agda and Idris are way more interesting from an advanced type system point of view.
Re:Dhall: A Gateway Drug to Haskell by ParetoOptimal on Wednesday June 08, 2022 @03:19AM (#31664316)
> Dependently Typed languages like Agda and Idris are way more interesting from an advanced type system point of view.

Yeah, but with Haskell you have a usable healthy ecosystem for real world code now.

Re:Dhall: A Gateway Drug to Haskell by mbrodersen on Wednesday June 08, 2022 @08:36PM (#31676298)
Yep that is correct. Which is why I am using Agda/Idris to expand my mind and F# for real world applications since F# can use the full .NET ecosystem.
Re:Dhall: A Gateway Drug to Haskell by foxes on Wednesday June 08, 2022 @04:22AM (#31664671)
>And to be snarky...

Lol, that is not how things work at all. An idea can be better and still be a minority. The imperative mindset has a lot of momentum.

Re:Dhall: A Gateway Drug to Haskell by haspok on Wednesday June 08, 2022 @03:42AM (#31664463)
I think people are missing the fact that Haskell was created for programming language research, and not for commercial purposes. It is somewhat of an accident that people started using it outside of its original domain. It was never meant for "general purpose SW".
Re:Dhall: A Gateway Drug to Haskell by jose_zap on Wednesday June 08, 2022 @04:31AM (#31664717)
The motivation for Haskell included building large applications. It was not solely a research language, but the culmination of years of research in non strict functional languages:

https://www.haskell.org/onlinereport/preface-jfp.html