skip to main content
10.1145/3597926.3604917acmconferencesArticle/Chapter ViewAbstractPublication PagesisstaConference Proceedingsconference-collections
research-article

Behaviorally Typed State Machines in TypeScript for Heterogeneous Swarms

Published:13 July 2023Publication History

ABSTRACT

A heterogeneous swarm system is a distributed system where participants come and go, communication topology may change at any time, data replication is asynchronous and partial, and local agents behave differently between nodes. These systems are hard to design and reason about, mainly because we desire a particular class of behaviors to emerge from the interplay of heterogeneous individual agents. Nevertheless, mission-critical operations like manufacturing process orchestration in factories use such systems due to their uncompromising availability and resilience of computing services.

This paper presents a set of TypeScript libraries to model peer-to-peer workflows as state machines, execute them using the Actyx middleware, and check the shape of these machines for conformance to a swarm protocol. The swarm protocol describes an idealized global view of the cooperation of machines of different roles. It directly corresponds to a diagram a product manager would sketch on a whiteboard; this allows for verifying that the coded state machines correctly implement the product specification. A well-formed swarm protocol also guarantees that conforming machines will achieve eventual consensus on the overall state progression even in the absence of further coordination. This tool is for developers of business logic for heterogeneous swarm systems, helping them verify that their protocols and implementations are correct.

Tool repo: https://github.com/Actyx/machines

References

  1. Actyx AG. 2020-2022. Actyx developer website. https://developer.actyx.com accessed 2023-05-18 Google ScholarGoogle Scholar
  2. Actyx AG. 2020–2023. Actyx Pond library. https://www.npmjs.com/package/@actyx/pond/v/3.4.0 Google ScholarGoogle Scholar
  3. Actyx AG. 2023. @actyx/machine-check library. https://www.npmjs.com/package/@actyx/machine-check/v/0.2.0 Google ScholarGoogle Scholar
  4. Actyx AG. 2023. @actyx/machine-runner library. https://www.npmjs.com/package/@actyx/machine-runner/v/0.3.1 Google ScholarGoogle Scholar
  5. Michael J. Fischer, Nancy A. Lynch, and Michael S. Paterson. 1985. Impossibility of Distributed Consensus with One Faulty Process. J. ACM, 32, 2 (1985), apr, 374–382. issn:0004-5411 https://doi.org/10.1145/3149.214121 Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Seth Gilbert and Nancy Lynch. 2002. Brewer’s conjecture and the feasibility of consistent, available, partition-tolerant web services. SIGACT News, 33, 2 (2002), June, 51–59. issn:0163-5700 https://doi.org/10.1145/564585.564601 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Roland Kuhn. 2021. Local-First Cooperation. https://www.infoq.com/articles/local-first-cooperation/ Google ScholarGoogle Scholar
  8. Roland Kuhn, Hernán Melgratti, and Emilio Tuosto. 2023. Behavioural Types for Local-First Software. arxiv:2305.04848. To appear in ECOOP Google ScholarGoogle Scholar
  9. Leslie Lamport. 2019. Time, Clocks, and the Ordering of Events in a Distributed System. Association for Computing Machinery, New York, NY, USA. 179–196. isbn:9781450372701 https://doi.org/10.1145/3335772.3335934 Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. R. A. Light. 2017. Mosquitto: server and client implementation of the MQTT protocol. The Journal of Open Source Software, 2, 13 (2017), https://doi.org/10.21105/joss.00265 Google ScholarGoogle ScholarCross RefCross Ref
  11. Microsoft. 2012-2023. TypeScript: JavaScript with Syntax for Types. https://www.typescriptlang.org/ Google ScholarGoogle Scholar
  12. STATELY. 2023. XState website. https://xstate.js.org/docs/ accessed 2023-05-18 Google ScholarGoogle Scholar
  13. Lewis Tseng. 2019. Eventual Consensus: Applications to Storage and Blockchain. In 2019 57th Annual Allerton Conference on Communication, Control, and Computing (Allerton). 840–846. https://doi.org/10.1109/ALLERTON.2019.8919675 Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Behaviorally Typed State Machines in TypeScript for Heterogeneous Swarms

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in
        • Published in

          cover image ACM Conferences
          ISSTA 2023: Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis
          July 2023
          1554 pages
          ISBN:9798400702211
          DOI:10.1145/3597926

          Copyright © 2023 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 13 July 2023

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article

          Acceptance Rates

          Overall Acceptance Rate58of213submissions,27%

          Upcoming Conference

          ISSTA '24
        • Article Metrics

          • Downloads (Last 12 months)49
          • Downloads (Last 6 weeks)12

          Other Metrics

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader