Please log in to watch this conference skillscast.
This talk will discuss how to apply the upcoming GHC language extension LinearTypes to manage references to values in a foreign language.
Our case study will be inline-java, a library that allows you to embed Java code in Haskell modules and integrates the JVM and the Haskell runtimes. Managing references to objects in the Java heap has remained an error-prone task. The programmer is responsible for deleting these references in a timely fashion. Delete too soon, and we get use-after-free errors. Delete too late, and we get intermittent OutOfMemory errors from the JVM. Forget to delete a few of them, and the memory of your application will grow steadily over time without an obvious cause.
We will show how linear types involve the compiler in checking that a program does a timely disposal of references to foreign values, effectively eliminating the most common bugs related to it.
YOU MAY ALSO LIKE:
- Implementing Inline-* (SkillsCast recorded in October 2018)
- Haskell eXchange 2021: Novice Track (Online Conference on 15th November 2021)
- Haskell eXchange 2021: Pro Track (Online Conference on 16th - 17th November 2021)
- Hashing Modulo Alpha Equivalence (SkillsCast recorded in May 2021)
- In The Belly Of The Whale: Tales From Haskell In The Enterprise (SkillsCast recorded in May 2021)
Typecheck Your Memory Management with Linear Types
Facundo Domínguez is a software engineer at Tweag IO. He has been using Haskell in industry during the last two decades, and he is long-time contributor to Haskell libraries and GHC. Of late, he coauthored the QualifiedDo language extension, and maintains inline-java, a library to bridge Haskell with Java.