An embedded domain-specific language for type-safe server-side web scripting
- 1 February 2005
- journal article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Internet Technology
- Vol. 5 (1) , 1-46
- https://doi.org/10.1145/1052934.1052935
Abstract
WASH/CGI is an embedded domain-specific language for server-side Web scripting. Due to its reliance on the strongly typed, purely functional programming language Haskell as a host language, it is highly flexible and---at the same time---it provides extensive guarantees due to its pervasive use of type information.WASH/CGI can be structured into a number of sublanguages addressing different aspects of the application. The document sublanguage provides tools for the generation of parameterized XHTML documents and forms. Its typing guarantees that almost all generated documents are valid XHTML documents. The session sublanguage provides a session abstraction with a transparent notion of session state and allows the composition of documents and Web forms to entire interactive scripts. Both are integrated with the widget sublanguage which describes the communication (parameter passing) between client and server. It imposes a simple type discipline on the parameters that guarantees that forms posted by the client are always understood by the server. That is, the server never asks for data not submitted by the client and the data submitted by the client has the type requested by the server. In addition, parameters are received in their typed internal representation, not as strings. Finally, the persistence sublanguage deals with managing shared state on the server side as well as individual state on the client side. It presents shared state as an abstract data type, where the script can control whether it wants to observe mutations due to concurrently executing scripts. It guarantees that states from different interaction threads cannot be confused.Keywords
This publication has 17 references indexed in Scilit:
- Extending Java for high-level Web service constructionACM Transactions on Programming Languages and Systems, 2003
- Programmable Type Systems for Domain Specific LanguagesElectronic Notes in Theoretical Computer Science, 2002
- The projectACM Transactions on Internet Technology, 2002
- A typed representation for HTML and XML documents in HaskellJournal of Functional Programming, 2002
- Developing a high-performance web server in Concurrent HaskellJournal of Functional Programming, 2002
- HTTP CookiesACM Transactions on Internet Technology, 2001
- Generalising monads to arrowsScience of Computer Programming, 2000
- Server side web scripting in HaskellJournal of Functional Programming, 2000
- A runtime system for interactive Web servicesComputer Networks, 1999
- Monad transformers and modular interpretersPublished by Association for Computing Machinery (ACM) ,1995