1. 12

From the abstract:

Linear type systems have a long and storied history, but not a clear path forward to integrate with existing languages such as OCaml or Haskell. In this paper, we study a linear type system designed with two crucial properties in mind: backwards-compatibility and code reuse across linear and non linear users of a library. Only then can the bene€ts of linear types permeate conventional functional programming. Rather than bifurcate types into linear and non-linear counterparts, we instead aŠach linearity to function arrows. Linear functions can receive inputs from linearly-bound values, but can also operate over unrestricted, regular values. To demonstrate the ecacy of our linear type system –both how easy it can be integrated in an existing language implementation and how streamlined it makes it to write programs with linear types — we implemented our type system in ghc, the leading Haskell compiler, and demonstrate two kinds of applications of linear types: mutable data with pure interfaces; and enforcing protocols in i/o-performing functions.

  1.  

  2. 4

    Woah this is really big no? Does this also unlock significant performance improvements while maintaining type safety?

    1. 4

      Yes I should think so; Rust has show that there are practical benefits to affine types, which are closely related to linear types. Whilst not new (Clean has had linear types since when? as has Mercury and others), it’s interesting to see it applied to Haskell. I’m definitely going to be watching this closely, and seeing where it goes, but exciting things are happening in F# and Haskell spaces (to say nothing of less popular languages as well)!

      1. 1

        Do you think this development might also extend to F#? very excited about -o

        1. 1

          I don’t know about F# right away, but F* is already in this space, so it’s only a matter of time.