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:
Typecheck Your Memory Management with Linear Types
Facundo Domínguez is a software engineer at Tweag. He has been using Haskell in industry during the last two decades, and he is a long-time contributor to Haskell libraries and GHC. Of late, he has been contributing to Liquid Haskell to make it easier and faster to use until it takes over the world.