18
views
0
recommends
+1 Recommend
0 collections
    0
    shares
      • Record: found
      • Abstract: found
      • Article: found
      Is Open Access

      Multiparty Session Type-safe Web Development with Static Linearity

      Preprint
      , ,

      Read this article at

      Bookmark
          There is no author summary for this article yet. Authors can add summaries to their articles on ScienceOpen to make them more accessible to a non-specialist audience.

          Abstract

          Modern web applications can now offer desktop-like experiences from within the browser, thanks to technologies such as WebSockets, which enable low-latency duplex communication between the browser and the server. While these advances are great for the user experience, they represent a new responsibility for web developers who now need to manage and verify the correctness of more complex and potentially stateful interactions in their application. In this paper, we present a technique for developing interactive web applications that are statically guaranteed to communicate following a given protocol. First, the global interaction protocol is described in the Scribble protocol language -- based on multiparty session types. Scribble protocols are checked for well-formedness, and then each role is projected to a Finite State Machine representing the structure of communication from the perspective of the role. We use source code generation and a novel type-level encoding of FSMs using multi-parameter type classes to leverage the type system of the target language and guarantee only programs that communicate following the protocol will type check. Our work targets PureScript -- a functional language that compiles to JavaScript -- which crucially has an expressive enough type system to provide static linearity guarantees. We demonstrate the effectiveness of our approach through a web-based Battleship game where communication is performed through WebSocket connections.

          Related collections

          Most cited references16

          • Record: found
          • Abstract: not found
          • Article: not found

          Multiparty Asynchronous Session Types

            Bookmark
            • Record: found
            • Abstract: not found
            • Article: not found

            Type classes in Haskell

              Bookmark
              • Record: found
              • Abstract: not found
              • Article: not found

              From bytecode to JavaScript: the Js_of_ocaml compiler

                Bookmark

                Author and article information

                Journal
                02 April 2019
                Article
                10.4204/EPTCS.291.4
                1904.01287
                6dc7c7c4-8bd7-421f-b895-ed6177fa4050

                http://arxiv.org/licenses/nonexclusive-distrib/1.0/

                History
                Custom metadata
                EPTCS 291, 2019, pp. 35-46
                In Proceedings PLACES 2019, arXiv:1904.00396
                cs.PL cs.SE
                EPTCS

                Software engineering,Programming languages
                Software engineering, Programming languages

                Comments

                Comment on this article