一句话:改造 MLton 的运行时(线程、对象模型、GC),使 Standard ML 可用于实时与嵌入式系统。
在实时与嵌入式场景中使用函数式语言正受到越来越多的关注,因为这类语言通常有严格类型、便于形式化方法、可变状态有限且并发控制机制简单而强大。然而,尽管已有许多面向嵌入式与实时系统的专用领域语言方案,将通用函数式语言适配到这些领域的进展却相对有限。本文介绍了作者在嵌入式与实时领域利用 Standard ML(SML)的当前工作,详细阐述了为适应此类场景而修改 MLton(SML 的全程序优化编译器)的经验。工作重点主要在语言运行时,重新设计了线程子系统、对象模型和垃圾回收器。作者还给出了将基于雷达的飞机碰撞检测器移植到 SML 后的初步结果。
Abstract There is a growing interest in leveraging functional programming languages in real-time and embedded contexts. Functional languages are appealing as many are strictly typed, amenable to formal methods, have limited mutation, and have simple but powerful concurrency control mechanisms. Although there have been many recent proposals for specialized domain-specific languages for embedded and real-time systems, there has been relatively little progress on adapting more general purpose functional languages for programming embedded and real-time systems. In this paper, we present our current work on leveraging Standard ML (SML) in the embedded and real-time domains. Specifically, we detail our experiences in modifying MLton, a whole-program optimizing compiler for SML, for use in such contexts. We focus primarily on the language runtime, reworking the threading subsystem, object model, and garbage collector. We provide preliminary results over a radar-based aircraft collision detector ported to SML.
DOI 原文 ·
@article{paperbot1248,
title = {Real-time MLton: A Standard ML runtime for real-time functional programs},
author = {BHARGAV SHIVKUMAR and JEFFREY MURPHY and LUKASZ ZIAREK},
journal = {Journal of Functional Programming},
volume = {31},
year = {2021},
doi = {10.1017/s0956796821000174}
}