Please use this identifier to cite or link to this item:
http://hdl.handle.net/10362/131602
Title: | Retrofitting Typestates into Rust |
Author: | Duarte, José Ravara, António |
Keywords: | Behavioral Typing Domain-specific Languages Macros Protocol Compliance Rust Session Types Typestates Human-Computer Interaction Computer Networks and Communications Computer Vision and Pattern Recognition Software |
Issue Date: | 27-Sep-2021 |
Publisher: | ACM - Association for Computing Machinery |
Citation: | Duarte, J., & Ravara, A. (2021). Retrofitting Typestates into Rust. In CBSOFT 2021 - Brazilian Conference on Software; Proceedings - 25th Brazilian Symposium on Programming Languages, SBLP 2021 (pp. 83-91). (ACM International Conference Proceeding Series). ACM - Association for Computing Machinery. https://doi.org/10.1145/3475061.3475082 |
Abstract: | As software permeates our lives, bugs become increasingly expensive; the best way to reduce their cost is to reduce the number of bugs. Of course, this is easier said than done and, at best, we can go after their root causes to mitigate them. One of such causes is state, whether it is the state of a light bulb (i.e. on/off), or the state of a complex protocol, reasoning about state is a complex process which developers are required to do with subpar tools. Ideally, we want to specify constraints and have the computer reason for us; typestates enable developers to describe states using the type system and allow the compiler to reason about them. We propose an approach to bring typestates to Rust, without any external tools, leveraging only Rust's type and macro systems. Our approach provides a macro-based domain-specific language which enables developers to easily express and implement typestates, along with certain state machine safety guarantees, it is open-source and available at https://github.com/rustype/typestate-rs. |
Peer review: | yes |
URI: | http://hdl.handle.net/10362/131602 |
DOI: | https://doi.org/10.1145/3475061.3475082 |
ISBN: | 9781450390620 |
Appears in Collections: | FCT: DI - Documentos de conferências internacionais |
Files in This Item:
File | Description | Size | Format | |
---|---|---|---|---|
Retrofitting_Typestates_into_Rust.pdf | 744,09 kB | Adobe PDF | View/Open |
Items in Repository are protected by copyright, with all rights reserved, unless otherwise indicated.