Manuel Chakravarty


Lambda Scientist

Manuel is a researcher of programming languages & compilers, a developer of Mac & iOS software, and a teacher of software development.

He is the principal developer of Haskell for Mac, a unique programming environment for the Haskell programming language that enhances learning and experimenting with code. Most of his academic work at the University of New South Wales (UNSW), Sydney, is related to functional or parallel programming — check out his research papers.

YOW! Lambda Jam 2017 Sydney

Haskell SpriteKit — A Purely Functional API for a Stateful Animation System & Physics Engine


Graphics, animation, and games programming in Haskell faces a dilemma. We can either use existing frameworks with their highly imperative APIs (such as OpenGL, Cocos2D, or SpriteKit) or we waste a lot of energy trying to re-engineer those rather complex systems from scratch. Or, maybe, we can escape the dilemma. Instead of a Haskell program directly manipulating the mutable object-graph of existing high-level frameworks, we provide an API for purely functional transformations of a Haskell data structure, together with an adaptation layer that transcribes those transformations into edits of the mutable object-graph.

In this talk, I will explain how I used this approach to architect a Haskell binding to the animation system and physics engine of Apple’s SpriteKit framework. I will discuss both how the binding is structured internally and how it achieves the translation of Haskell side changes to SpriteKit and vice versa, such that it is sufficiently efficient. Moreover, I will explain how to use the Haskell library to implement animations and games.