“So, one of the great things about Haskell actually, that is spoken about and I think it’s the sort of killer app for Haskell, is that it’s so refactorable, right? You can do a heart or lung transplant on GHC and make truly major changes and the type checker just guides you to do all the right things.”
Freely refactoring the code with worrying about unit tests, etc seems quite appealing.
To summarize the killer app for Haskell is that “it’s so refactorable”
> You can do a heart or lung transplant on GHC and make truly major changes and the type checker just guides you to do all the right things.
I thought GHC was famously a nightmare to work in?
> GHC is not exemplary of good large scale system design in a pure function language. Rather ironically, it violates the properties that draw people to functional programming in the first place: immutability, modularity, and composability
> many new features have been force-fitted into the existing code without proper redesign
> While the current design isn’t glorious, it works
We use Haskell at Bitnomial, and I can confirm that this is in fact the case. We've been able to incorporate new complex knowledge quickly in a way that most other languages would have more trouble with. Refactoring is a secret weapon for Haskell.
> You can do a heart or lung transplant on GHC and make truly major changes and the type checker just guides you to do all the right things.
This only tells that SPJ never had to work in hard realtime nor kernels.
GHC code throws and doesn't help in violating latency bounds. Not at all. For such tasks we do have much better systems, without GC.
> JB: So is it refreshing to to work on an implementation of a language from scratch after having worked on this 20-30 years old codebase in GHC and all this big beast where you can’t just redo everything from scratch?
> SPJ: It’s a very different prospectus because in this case Verse is a pretty well-formed beast in Tim’s head. If we want to do something different we’re going to have to persuade him but I’m fine with that, right? But the dynamic is that he’s a sort of technical lead on the project – which is very unusual for the CEO of a multibillion dollar company and actually quite rewarding.
Any tips on other professors like SPJ? He seems like a super human even after the 10 years Ive followed him. Never angry, always happy, always engaged, always teaching things with depth, not dumbing things down to make it easier, not pandering…
Most academics don’t have as many interviews and talks uploaded with them as SPJ but check out Stephanie Weirich’s Strange Loop talk[1] and interview on Corecursive.[2]
Why is Haskell, a comparatively obscure language (to Python, C++, etc.), so popular with topics in the orbit of "web3" (blockchain, crypto, metaverse, etc.)?
OCaml also has some of that, with Tezos, and Rust with Solana. I think it's because functional languages are thought as producing safer code, which is important in this industry.
First, I'm not sure if Haskell is that popular in that space. But I'd say there's a combination of factors.
Python/C++ come with their issues and when starting a project from scratch (e.g. a blockchain), there's more flexibility in the choice of language. In the blockchain field, throwing buzzwords has proven useful to gather money and make some projects stand out (functional programming, formal verification...). Also academics love these language, so starting a project in Haskell/OCaml can get you contributions from academia, possibly some big names joining your team. And of course, strongly typed languages with a clean semantics give you more safety which is important in some fields.
Functional programming lends itself well to finance through correctness and also the fact everything you do is basically data in -> data out. Versus other domains where using stateful objects to model things is easier.
Mainly because using monadic I/O trivially encourages you to write pure (deterministic) code for most of your programs, which makes it easy to write tests for them. Besides that, it's easy to write great libraries, which then makes the language very expressive. The downside is that the cognitive load for using it can be very high, but looking at C++ it seems clear that high cognitive loads are a feature across the industry, and here to stay.
I think I operate in those orbits, but I haven't come across much Haskell (plenty of TS, Golang, Rust). Where Haskell has cropped up it was typically in the context of "we want to prove this code is correct" (plausibly important if money is being transacted), plus a bit of "we like Haskell so we used it".
melling|3 years ago
“So, one of the great things about Haskell actually, that is spoken about and I think it’s the sort of killer app for Haskell, is that it’s so refactorable, right? You can do a heart or lung transplant on GHC and make truly major changes and the type checker just guides you to do all the right things.”
Freely refactoring the code with worrying about unit tests, etc seems quite appealing.
To summarize the killer app for Haskell is that “it’s so refactorable”
chrisseaton|3 years ago
I thought GHC was famously a nightmare to work in?
> GHC is not exemplary of good large scale system design in a pure function language. Rather ironically, it violates the properties that draw people to functional programming in the first place: immutability, modularity, and composability
> many new features have been force-fitted into the existing code without proper redesign
> While the current design isn’t glorious, it works
https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf
ploppyploppy|3 years ago
WraithM|3 years ago
rurban|3 years ago
This only tells that SPJ never had to work in hard realtime nor kernels. GHC code throws and doesn't help in violating latency bounds. Not at all. For such tasks we do have much better systems, without GC.
wallscratch|3 years ago
xwowsersx|3 years ago
> SPJ: It’s a very different prospectus because in this case Verse is a pretty well-formed beast in Tim’s head. If we want to do something different we’re going to have to persuade him but I’m fine with that, right? But the dynamic is that he’s a sort of technical lead on the project – which is very unusual for the CEO of a multibillion dollar company and actually quite rewarding.
Quite unusual and very cool!
nextos|3 years ago
"So, for me, that’s as far as increasing our ability to give you statically guaranteed theorems about Haskell programs.
My money’s on Liquid Haskell at the moment and I hope that we the Haskell community"
My experience is that other refinement type systems are way less complex. See: https://github.com/hwayne/lets-prove-leftpad
In particular, compare https://github.com/hwayne/lets-prove-leftpad/blob/master/liq... to https://github.com/hwayne/lets-prove-leftpad/blob/master/daf...
For me this has been a bit of a disappointment.
danielscrubs|3 years ago
nequo|3 years ago
[1] https://youtube.com/watch?v=wNa3MMbhwS4
[2] https://corecursive.com/015-dependant-types-in-haskell-with-...
reikonomusha|3 years ago
nequo|3 years ago
The applications I’ve heard for Idris also have to do with finance (although not blockchain stuff).
Zababa|3 years ago
yodsanklai|3 years ago
Python/C++ come with their issues and when starting a project from scratch (e.g. a blockchain), there's more flexibility in the choice of language. In the blockchain field, throwing buzzwords has proven useful to gather money and make some projects stand out (functional programming, formal verification...). Also academics love these language, so starting a project in Haskell/OCaml can get you contributions from academia, possibly some big names joining your team. And of course, strongly typed languages with a clean semantics give you more safety which is important in some fields.
Mikeb85|3 years ago
cryptonector|3 years ago
dboreham|3 years ago
unknown|3 years ago
[deleted]