Mobile game programming in Haskell
Mobile game programming in Haskell
复制标题
Haskell 中的手机游戏编程
DOI:
--
复制
发表时间:
2019
期刊:
影响因子:
--
通讯作者:
Ivan Perez
中科院分区:
文献类型:
--
作者:
Christina Zeller;Ivan Perez
The use of pure functional languages for interactive applications, especially mobile applications and games, is still rare. Reasons include the lack of libraries and frameworks that implement necessary features, poor integration with existing toolchains, and the lack of examples that demonstrate how to best structure large interactive applications in a way that is scalable in terms of performance and modularity. In this paper we identify three specific challenges that limit the application of functional programming specifically to mobile apps and games: purity, compositionality, and abstraction. We discuss solutions to these problems, and propose a framework for mobile app programming that completely separates logic from IO, resulting in an architecture that is referentially transparent, modular, scalable, backend agnostic and trivial to test. We implement this proposal in FAWN, a collection of libraries that provide higher-level notions needed in commercial applications, like resource management, widgets, storing user preferences, audio playing, image rendering, and composable applications. We have verified the suitability of this approach by using it to build, in Haskell, six mobile games for iOS and Android.