Taming stateful computations in Rust with typestates

Detalhes bibliográficos
Autor(a) principal: Duarte, José
Data de Publicação: 2022
Outros Autores: Ravara, António
Tipo de documento: Artigo
Idioma: eng
Título da fonte: Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)
Texto Completo: http://hdl.handle.net/10362/144754
Resumo: and by the EU H2020 RISE programme under the Marie Skłodowska-Curie grant agreement No 778233 . Publisher Copyright: © 2022 The Author(s)
id RCAP_52365f8851e371c03ef88f0bdceff659
oai_identifier_str oai:run.unl.pt:10362/144754
network_acronym_str RCAP
network_name_str Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)
repository_id_str 7160
spelling Taming stateful computations in Rust with typestatesBehavioral typesDSLMeta-programmingRustTypestateSoftwareHuman-Computer InteractionComputer Networks and Communicationsand by the EU H2020 RISE programme under the Marie Skłodowska-Curie grant agreement No 778233 . Publisher Copyright: © 2022 The Author(s)As our lives become increasingly more reliant on software, the impact of its failures grows as well; these failures have diverse causes and their impact ranges from negligible to life-threatening; thus, it is our duty as developers to minimize their occurrence, just as other fields do. To that end, we build abstractions, move complexity from component to component, and much more, just to stop the end-user from shooting themselves in the foot. However, building said abstractions still requires the original author to know where the pitfalls lie and how to avoid them, an implicit contract that does not constitute a guarantee that they will not shoot themselves and their users in the feet. Rust aims to minimize the amount of handguns users have at their disposal, locking them behind special unsafe blocks and restricting the set of possible programs through static analysis; this analysis is performed by the compiler which ensures that the program does not contain memory related errors such as use-after-free bugs. While Rust is able to succeed in the previous domain, other error classes persist, such as errors related to API misusage. Our work aims to tackle that domain, providing a tool which enables developers to write safer APIs using typestates. We propose a macro which embeds a typestate description DSL in Rust which allows developers to specify typestates for their APIs; the typestate is checked at compile-time for common mistakes and to ensure the correct usage of the typestate, we leverage Rust's type system. Our work only requires a Rust compiler, avoiding workflow bloat and keeping the development experience simple; it is open-source and available at https://github.com/rustype/typestate-rs.NOVALincsRUNDuarte, JoséRavara, António2022-10-14T22:15:47Z2022-102022-10-01T00:00:00Zinfo:eu-repo/semantics/publishedVersioninfo:eu-repo/semantics/article13application/pdfhttp://hdl.handle.net/10362/144754eng2590-1184PURE: 47097169https://doi.org/10.1016/j.cola.2022.101154info:eu-repo/semantics/openAccessreponame:Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)instname:Agência para a Sociedade do Conhecimento (UMIC) - FCT - Sociedade da Informaçãoinstacron:RCAAP2024-03-11T05:24:38Zoai:run.unl.pt:10362/144754Portal AgregadorONGhttps://www.rcaap.pt/oai/openaireopendoar:71602024-03-20T03:51:44.405924Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos) - Agência para a Sociedade do Conhecimento (UMIC) - FCT - Sociedade da Informaçãofalse
dc.title.none.fl_str_mv Taming stateful computations in Rust with typestates
title Taming stateful computations in Rust with typestates
spellingShingle Taming stateful computations in Rust with typestates
Duarte, José
Behavioral types
DSL
Meta-programming
Rust
Typestate
Software
Human-Computer Interaction
Computer Networks and Communications
title_short Taming stateful computations in Rust with typestates
title_full Taming stateful computations in Rust with typestates
title_fullStr Taming stateful computations in Rust with typestates
title_full_unstemmed Taming stateful computations in Rust with typestates
title_sort Taming stateful computations in Rust with typestates
author Duarte, José
author_facet Duarte, José
Ravara, António
author_role author
author2 Ravara, António
author2_role author
dc.contributor.none.fl_str_mv NOVALincs
RUN
dc.contributor.author.fl_str_mv Duarte, José
Ravara, António
dc.subject.por.fl_str_mv Behavioral types
DSL
Meta-programming
Rust
Typestate
Software
Human-Computer Interaction
Computer Networks and Communications
topic Behavioral types
DSL
Meta-programming
Rust
Typestate
Software
Human-Computer Interaction
Computer Networks and Communications
description and by the EU H2020 RISE programme under the Marie Skłodowska-Curie grant agreement No 778233 . Publisher Copyright: © 2022 The Author(s)
publishDate 2022
dc.date.none.fl_str_mv 2022-10-14T22:15:47Z
2022-10
2022-10-01T00:00:00Z
dc.type.status.fl_str_mv info:eu-repo/semantics/publishedVersion
dc.type.driver.fl_str_mv info:eu-repo/semantics/article
format article
status_str publishedVersion
dc.identifier.uri.fl_str_mv http://hdl.handle.net/10362/144754
url http://hdl.handle.net/10362/144754
dc.language.iso.fl_str_mv eng
language eng
dc.relation.none.fl_str_mv 2590-1184
PURE: 47097169
https://doi.org/10.1016/j.cola.2022.101154
dc.rights.driver.fl_str_mv info:eu-repo/semantics/openAccess
eu_rights_str_mv openAccess
dc.format.none.fl_str_mv 13
application/pdf
dc.source.none.fl_str_mv reponame:Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)
instname:Agência para a Sociedade do Conhecimento (UMIC) - FCT - Sociedade da Informação
instacron:RCAAP
instname_str Agência para a Sociedade do Conhecimento (UMIC) - FCT - Sociedade da Informação
instacron_str RCAAP
institution RCAAP
reponame_str Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)
collection Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)
repository.name.fl_str_mv Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos) - Agência para a Sociedade do Conhecimento (UMIC) - FCT - Sociedade da Informação
repository.mail.fl_str_mv
_version_ 1799138109923786752