Speaker Deck

Foreign Inline Code in Haskell (Haskell Symposium 2014)

by Manuel Chakravarty

Published September 5, 2014 in Programming

This talk was presented at the Haskell Symposium 2014 (Gothenburg, Sweden). A video of the talk is available from http://www.youtube.com/watch?v=pm_WFnWqn20

I show that quasiquoting in Template Haskell enables a new form of language interoperability. Specifically, for C-like languages it presents a purely library-based system for inline C code in Haskell. This dramatically simplifies language interoperability, and especially, the use of frameworks and libraries written in C-like languages from Haskell. It is, for example, helpful in applications based on native GUI libraries and projects integrating code written in multiple languages.

In this talk, I outline the limitations of existing approaches to using foreign libraries from Haskell. I argue that we can improve the situation with foreign inline code and demonstrate the approach at a few examples that interoperate with Objective-C.