Mobile game programming in Haskell

Mobile game programming in Haskell
复制标题

Haskell 中的手机游戏编程

DOI:
--
复制
发表时间:
2019
期刊:
FARM@ICFP
影响因子:
--
通讯作者:
Ivan Perez
Ivan Perez
中科院分区:
--
文献类型:
--
作者:
Christina Zeller;Ivan Perez

文献摘要

被引文献

相似文献

纯粹的功能语言在交互式应用程序中,尤其是移动应用程序和游戏,仍然很少见。原因包括缺乏实现必要功能的库和框架,与现有工具链的集成不佳,以及缺乏示例,这些示例表明如何以可扩展性的性能和模块化方式最佳地构建大型交互式应用程序。在本文中,我们确定了限制功能编程专门针对移动应用程序和游戏的三个特定挑战:纯度,组成性和抽象。我们讨论了这些问题的解决方案,并为移动应用程序编程提供了一个框架,该框架将逻辑与IO完全分开,从而产生了一种引用透明,模块化,可扩展性,后端不可知论和琐碎测试的体系结构。我们在Fawn中实施了此建议,该提案集合在商业应用程序中提供了需要更高级别的概念,例如资源管理,小部件,存储用户偏好,音频播放,图像渲染和可组合应用程序。我们已经通过使用该方法来构建iOS和Android的六个手机游戏来验证这种方法的适用性。
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.