Please log in to watch this conference skillscast.
Join Facundo Domínguez as he discusses using the new language extension LinearTypes to safely manage references to foreign objects/values when integrating Haskell with other languages.
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:
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.