Simon Peyton Jones - Linear Haskell: practical linearity in a higher-order polymorphic language

Channel:Curry On! · Length:1:03:33 · Published:2018-07-23 · Views:18856

Watch on YouTube

Summary

Simon Peyton Jones presents linear types for Haskell, showing how practical linearity can fit into a higher-order polymorphic language. The talk covers motivations such as resource handling and relates the ideas to Rust.

Why HN recommends it

HN recommends it as a clear introduction to linear types in GHC from the language's lead designer.

Simon Peyton Jones has a great talk on YouTube [3] — HN, 2020

Programming language design · Functional programming

Subtitles (excerpt)

All right. Now we have to do this sloppy sloppy business. And uh I'm a bit echoey, aren't I? Can you um And with a bit of luck with a bit of luck No, yes. Almost. Almost. So, now I have to do a um Think if I do duplicate, that sometimes works. Good? Oh, that's not good. Now, you're just getting this kind of game. All right, let's try again. This As I As As ever, this worked perfectly well before the screens went down. Okay, good. Um All right, are we good to go? Can you hear? Can you hear Is it too loud or you you uh No, it's okay. It's okay, thumbs up. Excellent. All right. Start the stopwatch. We have We have 50 minutes to learn about linear types. So, I don't know about you, I find linear types extremely confusing. Um they're sort of uh attractive, alluring, something like an Escher diagram. You look at them and you think that's extremely cool and then you find you they sort of uh arrive back where you first began. So, uh look at this. So, if you search for linear types in uh you know, Google Scholar, you get 750 results, you know, and with Phil um prominently at the top for uh uh some reason. If you search for linear logic you get 3,700 results. So, this is an area dense with related work.

On Hacker News

SPJ usually makes great introductions about new things being introduced to GHC. Here's one about linear types: [VIDEO] > How do people that don't have PhDs bridge the gap in their knowledge from what's commonly taught/used (OOP and it's design patterns) to thinking in terms of monads/monoids/functors/etc. In my own experience, you just practice, and munch new knowledge bits by bits. The crucial p… — pyrale, 2020-09
Session Types, AFAIU are a specific implementation of a linear logic in some type system and I am not all too familiar with them in practice. However, I would like to think I am well versed in Linear Logic and Substructural Type Theory. I think the works by Wadler are a good place to start, in particular is a sort of review paper, based in intuitionistic logic (which he also covers in said paper)… — throwaway17_17, 2020-03
Something to keep in mind - linear types are on their way[1], with exactly this usecase in mind. Simon Peyton Jones gave an excellent presentation on the topic[2], briefly discussing exceptions, as well as giving a mention to ResourceT and the phantom type solution in the article (described as channel-passing). [1] [LINK] [2] [VIDEO] — T-R, 2018-10
My understanding is that the current implementation is only groundwork for possible future performance benefits, since there are no changes to the runtime system or garbage collector, and that their current intended use is mostly for allowing library authors to encode safe session/resource handling in the type system. So, new libraries can make it a type error to fail to properly close a connecti… — T-R, 2020-09
Simon Peyton Jones initial intuition [0] was that Rust would be full of soundness holes due to not starting with a full formalization. Derek Dryer, Ralf Jung and others in the RustBelt project [1] did amazing work in formalizing Rust's safety guarantees, showing that Peyton Jones' guess was not accurate. There is nothing wrong about having bugs, of course, but the reaction to the bug in this thre… — mauricioc, 2019-11

Related videos