Nothing Special   »   [go: up one dir, main page]

skip to main content
article

An embedded domain-specific language for type-safe server-side web scripting

Published: 01 February 2005 Publication History

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.

References

[1]
Atkinson, D., Ball, T., Benedikt, M., Bruns, G., Cox, K., Mataga, P., and Rehor, K. 1997. Experience with a domain specific language for form-based services. In Proceedings of the Conference on Domain-Specific Languages (DSL) (Santa Barbara, Calif.). USENIX.]]
[2]
Berners-Lee, T., Fielding, R. T., and Masinter, L. 1998. Uniform resource identifiers (URI): Generic syntax. http://www.faqs.org/ftp/rfc/rfc2396.txt.]]
[3]
blog 2003. blog. http://www.webopedia.com/TERM/B/blog.html.]]
[4]
Brabrand, C., Møller, A., Sandholm, A., and Schwartzbach, M. I. 1999. A runtime system for interactive Web services. Comput. Netw. 31, 11--16, 1391--1401.]]
[5]
Brabrand, C., Møller, A., and Schwartzbach, M. 2002. The <bigwig> Project. ACM Trans. Internet Tech. 2, 2, 79--114.]]
[6]
CGI 1.0 1999. CGI: Common gateway interface. http://www.w3.org/CGI/.]]
[7]
Christensen, A. S., Møller, A., and Schwartzbach, M. I. 2003. Extending Java for high-level Web service construction. ACM Trans. Prog. Lang. Syst. 25, 6, 814--875.]]
[8]
Eastlake, 3rd, D. E., and Goldstein, T. 2001. ECML v1.1: Field specifications for E-commerce. http://www.faqs.org/rfcs/rfc3106.html.]]
[9]
Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., and Berners-Lee, T. 1999. Hypertext transfer protocol. http://www.faqs.org/rfcs/rfc2616.html.]]
[10]
Graunke, P., Findler, R. B., Krishnamurthi, S., and Felleisen, M. 2001. Automatically restructuring programs for the Web. In Proceedings of ASE-2001: The 16th IEEE International Conference on Automated Software Engineering (San Diego, Calif.). IEEE Computer Society Press, Los Alamitos, Calif., pp. 211--222.]]
[11]
Graunke, P. T., Findler, R. B., Krishnamurthi, S., and Felleisen, M. 2003. Modeling Web interactions. In Proceedings of the 12th European Symposium on Programming (Warsaw, Poland). Lecture Notes in Computer Science. Springer-Verlag, New York.]]
[12]
Graunke, P. T. and Krishnamurthi, S. 2002. Advanced control flows for flexible graphical user interfaces: or, growing GUIs on trees or, bookmarking GUIs. In Proceedings of the 24th International Conference on Software Engineering (ICSE-02) (New York, NY.). ACM, New York, pp. 277--296.]]
[13]
Gutmann, P. 1998. Software generation of practically strong random numbers. In Proceedings of the 7th USENIX Security Symposium (San Antonio, Tex.). USENIX.]]
[14]
Hanus, M. 2001. High-level server side Web scripting in Curry. In Practical Aspects of Declarative Languages, Proceedings of the Third International Workshop, PADL'01. Lecture Notes in Computer Science (Las Vegas, Nev.). Springer-Verlag, New York.]]
[15]
Haskell98. 1998. Haskell 98, a non-strict, purely functional language. http://www.haskell.org/definition.]]
[16]
Homer, A. and Sussman, D. 2002. Professional ASP.NET 1.0 (2 ed.). Wrox Press Inc.]]
[17]
Hughes, J. 2000. Generalising monads to arrows. Sci. Comput. Prog. 37, 67--111.]]
[18]
ISO (International Organization for Standardization). 1996. Information technology-Open systems interconnection-Remote procedure call (RPC). ISO/IEC 11578:1996.]]
[19]
Kristol, D. M. 2001. HTTP Cookies: Standard, privacy, and politics. ACM Trans. Internet Tech. 1, 2 (Nov.), 151--198.]]
[20]
Ladd, D. A. and Ramming, J. C. 1995. Programming the Web: An application-oriented language for hypermedia service programming. World Wide Web Consortium. pp. 567--586.]]
[21]
Levy, M. R. 1998. Web programming in Guide. Softw.--Pract. Exper. 28, 15 (Dec.), 1581--1603.]]
[22]
Liang, S., Hudak, P., and Jones, M. 1995. Monad transformers and modular interpreters. In Proceedings of the 1995 ACM SIGPLAN Symposium on Principles of Programming Language (San Francisco, Calif.). ACM, New York, pp. 333--343.]]
[23]
LuhnCheck 1999. Luhn formula. http://www.webopedia.com/TERM/L/Luhn_formula.html.]]
[24]
Marlow, S. 2002. Developing a high-performance Web server in Concurrent Haskell. J. Funct. Prog. 12, 4&5 (July), 359--374.]]
[25]
Meijer, E. 2000. Server-side Web scripting with Haskell. J. Funct. Prog. 10, 1 (Jan.), 1--18.]]
[26]
Netscape Corporation 2003. JavaScript central. http://devedge.netscape.com/central/javascript/.]]
[27]
Nørmark, K. 2002. Programmatic WWW authoring using Scheme and LAML. In Web Engineering Track of the 11th International World Wide Web Conferene---WWW2002, page 296.]]
[28]
Peligrí-Llopart, E. and Cable, L. 1999. Java Server Pages Specification. http://java.sun.com/products/jsp/index.html.]]
[29]
PHP. 2003. PHP: Hypertext processor. http://www.php.net/.]]
[30]
PSP. 1999. Python server pages. http://www.ciobriefings.com/psp/.]]
[31]
Queinnec, C. 2000. The influence of browsers on evaluators or, continuations to program Web servers. In Proc. International Conference on Functional Programming 2000 (Montreal, Ont., Canada). P. Wadler Ed. ACM, New York, pp. 23--33.]]
[32]
Scott, D. and Sharp, R. 2002. Abstracting application-level Web security. In Proceedings of 11th ACM International World Wide Web Conference (Hawaii). ACM, New York.]]
[33]
Sun Microsystems 2003. Java Servlet Specification, Version 2.4. http://java.sun.com/products/servlet/.]]
[34]
Thiemann, P. 2000. Modeling HTML in Haskell. In Practical Aspects of Declarative Languages, Proceedings of the Second International Workshop, PADL'00 (Boston, Mass.). Lecture Notes in Computer Science, vol. 1753. Springer-Verlag, Los Alamitos, Calif., pp. 263--277.]]
[35]
Thiemann, P. 2002a. Programmable type systems for domain specific languages. In Selected Papers of Workshop on Functional and Logic Programming, WFLP 2002, Volume 76 of ENTCS, (Grado, Italy). M. Comini and M. Falaschi, Eds. Elsevier Science Publishers, Amsterdam, The Netherlands.]]
[36]
Thiemann, P. 2002b. A typed representation for HTML and XML in Haskell. J. Funct. Prog. 12, 4-5 (July), 435--468.]]
[37]
Thiemann, P. 2003a. WASH/CGI reference manual. http://www.informatik.uni-freiburg.de/~thiemann/haskell/WASH. To appear.]]
[38]
Thiemann, P. 2003b. XML templates and caching in WASH. In Proceedings of the 2003 ACM SIGPLAN Haskell Workshop (Uppsala, Sweden). J. Jeuring, Ed. ACM, New York, pp. 19--26.]]
[39]
Validator. 2002. Markup validation service. http://validator.w3.org/.]]
[40]
WASH. 2001. Web authoring system in Haskell (WASH). http://www.informatik.uni-freiburg.de/~thiemann/haskell/WASH.]]
[41]
XHTML 1.0. 2000. XHTML 1.0: The extensible hypertext markup language. http://www.w3.org/TR/xhtml1.]]

Cited By

View all
  • (2018)Towards a Domain-Specific Language for the Renarration of Web PagesProceedings of the 11th Innovations in Software Engineering Conference10.1145/3172871.3172873(1-10)Online publication date: 9-Feb-2018
  • (2014)A Domain-Specific Language for XML Security StandardsProceedings of the 2014 European Conference on Software Architecture Workshops10.1145/2642803.2642821(1-7)Online publication date: 25-Aug-2014
  • (2012)Towards a Guaranteed (X)HTML Compliant Dynamic Web ApplicationWeb Information Systems and Technologies10.1007/978-3-642-28082-5_8(103-115)Online publication date: 2012
  • Show More Cited By

Recommendations

Reviews

Olivier Louis Marie Lecarme

This is a long paper (46 pages), but I found it to be much more useful than those ten-page papers in conference proceedings, where writers and readers together are frustrated by the forced brevity. The paper describes Web authoring system Haskell/common gateway interface (WASH/CGI), a scripting language that works on the server side of a Web dialogue. The idea is to circumvent the major difficulty of hypertext transfer protocol (HTTP) when it is used for managing a session between a user and the server; in fact, this protocol does not contain the idea of a session, and only lies on a very simple request-response model. When the client sends a new request after receiving a response, the preceding exchange has completely been forgotten. Many tricks and techniques are used for palliating this problem, but they generally lead to complicated programming, and many interdependent but separated scripts. Here, the proposed language and its inherent philosophy provide for a much more natural way of programming, namely, one program managing a complete session. Scripting languages are often designed in a completely ad hoc way. The result is a syntax that is often offensive, and a definition with many idiosyncrasies. Moreover, implementing the language requires major effort, thus it is difficult to improve it. Another solution is to use an existing, well-known language, extending it with what is needed. The difficulty is then to find a language that is really suited for this purpose. The author chose Haskell, which is not really well known. As a consequence, he is forced to devote several pages to giving readers a basic overview of this language. Moreover, the examples are not really easy to read, because of the surprising syntax. Haskell is supposed to be a purely functional language, but in order to make the language practically usable, it is necessary to use input-output operations, and have a way to express sequentiality. The originality of WASH/CGI is that the generated Extensible HTML (XHTML) pages are (almost) guaranteed to be valid. This important characteristic is obtained thanks to an intensive use of Haskell's strong typing system. This means that the examples in the paper are mainly type specifications, and thus are not really easy to read for a non-Haskell specialist. By comparison, the sections that describe the problem and the philosophy of the solution are much more accessible. A minor point to note: the font difference between plain text and programming examples is not enough to make some sentences very readable. Consider, for example, "A value of type HTMLField context a expects a sequence..." The meaning becomes clearer when you observe that the words "HTMLField context a" are printed in a different font. All in all, this paper is well structured and well written. Its contribution seems important, and thus I recommend reading it. Online Computing Reviews Service

Access critical reviews of Computing literature here

Become a reviewer for Computing Reviews.

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Transactions on Internet Technology
ACM Transactions on Internet Technology  Volume 5, Issue 1
February 2005
297 pages
ISSN:1533-5399
EISSN:1557-6051
DOI:10.1145/1052934
Issue’s Table of Contents
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 ACM 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: 01 February 2005
Published in TOIT Volume 5, Issue 1

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Interactive Web services
  2. Web programming

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)3
  • Downloads (Last 6 weeks)1
Reflects downloads up to 16 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2018)Towards a Domain-Specific Language for the Renarration of Web PagesProceedings of the 11th Innovations in Software Engineering Conference10.1145/3172871.3172873(1-10)Online publication date: 9-Feb-2018
  • (2014)A Domain-Specific Language for XML Security StandardsProceedings of the 2014 European Conference on Software Architecture Workshops10.1145/2642803.2642821(1-7)Online publication date: 25-Aug-2014
  • (2012)Towards a Guaranteed (X)HTML Compliant Dynamic Web ApplicationWeb Information Systems and Technologies10.1007/978-3-642-28082-5_8(103-115)Online publication date: 2012
  • (2011)JavaGIACM Transactions on Programming Languages and Systems10.1145/1985342.198534333:4(1-83)Online publication date: 1-Jul-2011
  • (2009)JavaGI in the battlefieldACM SIGPLAN Notices10.1145/1837852.162161945:2(65-74)Online publication date: 4-Oct-2009
  • (2009)JavaGI in the battlefieldProceedings of the eighth international conference on Generative programming and component engineering10.1145/1621607.1621619(65-74)Online publication date: 4-Oct-2009
  • (2009)How to CPS Transform a MonadProceedings of the 18th International Conference on Compiler Construction: Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 200910.1007/978-3-642-00722-4_19(266-280)Online publication date: 27-Mar-2009
  • (2008)Better abstractions for secure server-side scriptingProceedings of the 17th international conference on World Wide Web10.1145/1367497.1367566(507-516)Online publication date: 21-Apr-2008
  • (2008)Investigation of behavior and perception of digital library usersInternational Journal of Information Management: The Journal for Information Professionals10.1016/j.ijinfomgt.2007.10.00328:5(355-365)Online publication date: 1-Oct-2008
  • (2008)The Essence of Form AbstractionProceedings of the 6th Asian Symposium on Programming Languages and Systems10.1007/978-3-540-89330-1_15(205-220)Online publication date: 9-Dec-2008
  • Show More Cited By

View Options

Login options

Full Access

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media