There has been much recent interest in adopting functional and reactive programming for use in real-time system design. Moving toward a more declarative methodology for developing real-time systems purports to improve the fidelity of software. To study the benefits of functional and reactive programming for real-time systems, real-time aware functional compilers and language runtimes are required. In this paper we examine the necessary changes to a modern Standard ML compiler, MLton, to provide basic support for real-time execution. We detail our current progress in modifying MLton with a threading model that supports priorities, a chunked object model to support real-time garbage collection, and low level modification to execute on top of a real-time operating system. We present preliminary numbers and our work in progress prototype, which is able to boot ML programs compiled with MLton on x86 machines.
Functional programming languages play an important role in the development of correct software systems. As embedded devices become pervasive and perform critical tasks in our lives, their reliability becomes paramount. This presents a natural opportunity to explore the application of functional programming languages to systems that demand highly predictable behavior.In this paper, we explore existing functional programming language compilers and their applicability to real-time embedded systems. We do this by defining important characteristics needed by a real-time programming language and survey how well existing languages meet these characteristics. We conduct empirical analysis of language runtimes in order to assess the impact of dynamic memory management on predictability and performance. Lastly, we review different programming models for expressing real-time considerations in applications. INTRODUCTIONReal-time software is an integral part in many complex software/hardware systems that require timing guarantees in addition to traditional functional correctness guarantees. Such systems vary in nature, spanning multiple domains including industrial control, robotics, automotive, avionics, and medical devices, among others. These systems all provide services whose utility is dictated by the timeliness in which they respond to external (eg, sensor readings) and internal (eg, software events and interrupts) stimuli. Writing the software for these systems is a difficult undertaking because ensuring the system is correct requires providing predictability guarantees. This is exacerbated by the fact that most software for real-time systems is written in "low level" imperative languages.Functional languages are known for their ability to be reasoned about with respect to correctness, often with automated tools. 1-3 Given that real-time systems are frequently deployed in safety-critical and mission-critical situations, the ability to write software with a high degree of confidence in its correctness and predictability is important. Functional languages are well suited for the former task (correctness), but are not developed for the latter (predictability). Indeed, general purpose, functional programming languages are not used for developing real-time systems and there are no investigations to ensure their predictability. There are, however, many domain-specific functional languages that provide predictability for niche domains. The state of mainstream functional programming languages with respect to their ability to express and provide predictability is something we would like to investigate in this survey.One reason that functional languages are not considered for writing real-time software is because they are managed languages and automatic memory management has classically been considered unpredictable. While many may consider this a reason to reject functional programming as a target language for real-time systems development, we can instead look to managed object-oriented systems for inspiration. Indeed, the ques...
In this paper, we describe our experience incorporating gradual types in a statically typed functional language with Hindley-Milner style type inference. Where most gradually typed systems aim to improve static checking in a dynamically typed language, we approach it from the opposite perspective and promote dynamic checking in a statically typed language. Our approach provides a glimpse into how languages like SML and OCaml might handle gradual typing. We discuss our implementation and challenges faced—specifically how gradual typing rules apply to our representation of composite and recursive types. We review the various implementations that add dynamic typing to a statically typed language in order to highlight the different ways of mixing static and dynamic typing and examine possible inspirations while maintaining the gradual nature of our type system. This paper also discusses our motivation for adding gradual types to our language, and the practical benefits of doing so in our industrial setting.
In this extended abstract we present our current work on leveraging Standard ML for developing embedded and real-time systems. Specifically we detail our experiences in modifying MLton, a whole program, optimizing compiler for Standard ML, for use in such contexts. We focus primarily on the language runtime, reworking the threading subsystem and garbage collector, as well as necessary changes for integrating MLton generated programs into a light weight operating system kernel. We compare and contrast these changes to our previous work on extending MLton for multicore systems, which focused around acheiving scalability.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.
hi@scite.ai
334 Leonard St
Brooklyn, NY 11211
Copyright © 2024 scite LLC. All rights reserved.
Made with 💙 for researchers
Part of the Research Solutions Family.