Skip to content
0:00 / 0:00

#lineartypes#haskell#ghc

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

Curry On!

6.3K subscribers • 21 videos on Hallway

YouTube
  • Recommended by 5 people: 3 on Hacker News, 1 in engineering communities and 1 curated list.
  • Presented by Simon Peyton Jones, co-designer of Haskell

Advanced. Deep dive for people who know the field.

18K views8 years ago5 recommendations

Programming languagesLanguage design and type systemsFunctional programmingHaskell

Simon Peyton Jones explains how linear types can be practically integrated into a higher-order polymorphic language like Haskell.

The uploader added no description.

Why it's here

5 people recommend this

What people say. Highly recommended as an excellent introduction to linear types and resource management in functional programming languages.

Moments people linked to

u/n00bombin r/haskell • Recommends

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

programming-talkscurated list on GitHubRecommends

Under “Haskell”

Linear Haskell: practical linearity in a higher-order polymorphic language 01:03:33 by **Simon Peyton Jones** (2018)

T-Ron Hacker News • Recommends

On “Rust RAII is better than the Haskell bracket pattern”

Something to keep in mind - linear types are on their way1, with exactly this usecase in mind. Simon Peyton Jones gave an excellent presentation on the topic2, 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 link to this video

throwaway17_17on Hacker News • Recommends

On “Programming Models for Distributed Computation”

…cusses practical linear types for Haskell, but the theory is not Haskell specific. I will warn you that the latter two references make several arguments and then discuss uniqueness typing (which is related but very different) and that is a whole other rabbit hole of sources, but generally a good topic to dig into as well. 1 link 2 link 3 link to this video…

pyraleon Hacker News • Recommends

On “Haskell GHC 9.0.1-alpha”

SPJ usually makes great introductions about new things being introduced to GHC. Here's one about linear types: link to this 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 point here is that you don't need to know _all_ of haskell to be productive using it. So you learn the basics, start using monads without understanding the Monad abstraction (it's really not something you need to understand to use), and after a while it just clicks. And once you're confortable with th…

u/runeksin r/haskell • Mentions

Why is the primary focus of a linear types-proposal not increasing performance? In my opinion, the greatest weakness of Haskell -- as implemented by GHC -- is its "immutable" garbage collector. This causes certain algorithms implemented in idiomatic Haskell to be *n* times slower than their Java counterpart (e.g. weighted quick union find), because the GHC GC keeps allocating and freeing new arrays every time a single item in the array is updated (which takes time proportional to the size of the array). We can get around this by using stuff like the `ST` monad but -- in my opinion -- this means we lose what makes Haskell great, which is the ability to express outselves in terms of logic ra…

u/Goheecain r/haskell • Mentions

On “Linear Types Proposal conditionally accepted by the committee”

Here's a presentation from SPJ. Towards the end, it also compares the linearity designs of Haskell and Rust.

u/Iceland_jackin r/haskell • Mentions

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

*[32:53]* .. but now this type will mean there is a check that we don't accidentally, as some compiler optimization, duplicate the world (which is known to be difficult) or destroy the world (which is known to be undesirable).
20View on Reddit

u/jan_pathin r/haskell • Mentions

On “Linear Types Proposal conditionally accepted by the committee”

In his talk about linear types SPJ touches on exceptions. Here is link. Basically exceptions do not break linearity guarantees, because the guarantee of `a -o b` is that if `b` is consumed once, then `a` is consumed once, but in the case of an exception `b` is not consumed, so the guarantee still holds. For resource safety he proposes a monad `RIO` (resource-safe IO) with very limited `catch` which closes all open file handles in the end.
5View on Reddit

u/Goheecain r/haskell • Mentions

On “Pure destination-passing style in linear Haskell”

This presentation from SPJ on linearity polymorphism is great.
5View on Reddit

icc97on Hacker News • Mentions

On “Ask HN: What topics/subjects are worth learning for a new software engineer?”

…If ReasonML isn't too scary it leads you down a path to OCaml, F# and Elm * Rust (not strictly a functional programming language, but is ridiculously fast and contains well implemented Linear Types that makes Haskell's Simon Peyton-Jones jealous 0) - this is one of the most loved programming languages according to the Stack Overflow survey 0: link to this video…

mauriciocon Hacker News • Mentions

On “Unsoundness in Pin”

…er mathematical correctness is regarded in the Rust project as an explicit goal, an explicit non-goal or an unessential nice-to-have. (I do not mean to insinuate anything with the word "unclear", as I believe all three options are valid and appeal to different use cases. Almost all of the popular languages don't care about this, for instance.) 0 link to this video 1 link…

T-Ron Hacker News • Mentions

On “Haskell GHC 9.0.1-alpha”

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 connection or release a shared resource. Simon Peyton Jones talk: link to this video

u/theindigamerin r/ProgrammingLanguages • Mentions

On “Futhark 0.9.1 released - now with CUDA backend”

I was rewatching SPJ's talk on Linear Haskell and at 47:50, he shows a table with an unoccupied spot for Uniqueness types + linearity on the arrow. It seems to me that you have the same idea as Linear Haskell ("this is X iff that is X") but you're looking at uniqueness instead of counting uses. So Futhark would be a good candidate to fit in that empty slot?

u/balefrostin r/ProgrammingLanguages • Mentions

On “How comes OOP overemphasises nouns, as opposed to FP?”

True, but have linear types made it into any really mainstream functional languages yet? I know that Haskell was experimenting with them (there was a really good SPJ talk about them), but AFAIK it's still just a proposal.