top | item 33222995

Simon Peyton Jones interview

166 points| gbrown_ | 3 years ago |haskell.foundation

47 comments

order

melling|3 years ago

Around 7:50 in Jones says this:

“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

> 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

https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf

ploppyploppy|3 years ago

This is definitely my experience with the language, but mostly 'cause it's statically typed and compiled. I get a similar experience in Rust.

WraithM|3 years ago

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.

rurban|3 years ago

> 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.

wallscratch|3 years ago

Could someone explain why refactoring is so much easier in functional languages?

xwowsersx|3 years ago

> 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.

Quite unusual and very cool!

nextos|3 years ago

It's interesting he discusses Liquid Haskell (proofs via refinement types) extensively:

"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

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…

reikonomusha|3 years ago

Why is Haskell, a comparatively obscure language (to Python, C++, etc.), so popular with topics in the orbit of "web3" (blockchain, crypto, metaverse, etc.)?

nequo|3 years ago

The usual argument is that purity and the type system help you write correct code and finance is a domain where correctness is important.

The applications I’ve heard for Idris also have to do with finance (although not blockchain stuff).

Zababa|3 years ago

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.

yodsanklai|3 years ago

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.

Mikeb85|3 years ago

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.

cryptonector|3 years ago

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.

dboreham|3 years ago

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".