Abstract
This paper describes the experience of implementing a core component of an operationally deployed large distributed system in Scheme. Metcast is a request-reply and subscription system for the dissemination of real-time weather information. The system stores vast amounts of weather observation reports, forecasts, gridded data produced by weather models, and satellite imagery. A Metcast server delivers a subset of these data in response to a query formulated in a domain-specific declarative language. Decoders of World Meteorological Organization's data feed, the Metcast application server, XML encoders and decoders, auxiliary and monitoring CGI scripts are all written in a mostly pure functional subset of Scheme. This paper describes three examples that demonstrate the benefits of our choice of the implementation language: parsing of the data feed; XML transformations and Web services; a modular interpreter for the extensible and expressive request language. We also discuss general-purpose extensions to Scheme developed in the project.
Similar content being viewed by others
References
American National Standard for Information Systems. Programming Languages. Forth. Document X3.215-1994. March 24, 1994.
Cerami, E. Web Services Essentials. Distributed Applications with XML-RPC, SOAP, UDDI & WSDL, O'Reilly & Associates, 2002.
Feeley, M. Gambit Scheme System, August 2002. http://www.iro.umontreal.ca/~gambit/
Kiselyov, O. A delegation language to request weather products and a scheme of its interpretation. In Proc. third ACM SIGPLAN Int. Conf. on Functional Programming (ICFP'98), Baltimore, Maryland, Sep. 27–29 1998, p. 343.
Kiselyov, O. AND-LET*: an AND with local bindings, a guarded LET* special form. Scheme Request for Implementation: SRFI-2. March 1, 1999. http://srfi.schemers.org/srfi-2/
Kiselyov, O. File, directory, network, and other OS/POSIX interfaces. Ports and the enhanced I/O. August 2001. http://pobox.com/~oleg/ftp/Scheme/OS-interf.html#enhanced-port-io
Kiselyov, O. Weather Observation Definition Format. September 18, 2002. http://www.metnet.navy.mil/Metcast/XML/OMF.html
Kiselyov, O. SXML specification. ACM SIGPLAN Notices, 37(6) (2002) 52–58. http://pobox.com/~oleg/ftp/Scheme/SXML.html
Kiselyov, O. A better XML parser through functional programming. Proc. PADL2002: Practical Aspects of Declarative Languages, 4th International Symposium. Portland, OR, U.S.A., January 19–20, 2002. In Lecture Notes in Computer Science, Vol. 2257. Springer-Verlag, Berlin Heidelberg New York, 2002, pp. 209–224.
Kiselyov, O. and Lisovsky, K. XML, XPath, XSLT implementations as SXML, SXPath, and SXSLT. In Proc. International Lisp Conference, ILC 2002: San Francisco, CA, October 27–31, 2002. http://pobox.com/~oleg/ftp/papers/SXs.pdf; http://pobox.com/~oleg/ftp/papers/SXs-talk.pdf
Kiselyov, O. Distributing weather products through an HTTP pipe. February 20, 2003. http://www.metnet.navy.mil/Metcast/http://pobox.com/~oleg/JMV-TNG/
Kiselyov, O. Metcast Table of Contents (MTOC). May 22, 2003. http://www.metnet.navy.mil/Metcast/XML/MTOC.html
Kiselyov, O. Scheme Hash. An archive of Scheme code. April 4, 2003. http://pobox.com/~oleg/ftp/Scheme/
Kiselyov, O. and Krishnamurthi, S. SXSLT: Manipulation language for XML. In Proc. PADL2003: Practical aspects of declarative languages, 5th international symposium. New Orleans, LA, U.S.A., January 13–14, 2003. In Lecture Notes in Computer Science, Vol. 2562. Springer-Verlag, Berlin Heidelberg, New York (2003) 256–272.
Landin, P.J. The next 700 programming languages. Communications of the ACM, 9(3) (1966) 157–166.
McKusick, M.K., Bostic, K., Karels, M.J., and Quarterman, J.S. The Design and Implementation of the 4.4BSD Operating System. Addison-Wesley Longman, Inc. 1996.
Moertel, T. XSLT, Perl, Haskell, & a word on language design. Posted on kuro5hin.org on January 15, 2002.http://www.kuro5hin.org/story/2002/1/15/1562/95011
National Weather Service. Office of the Federal Coordinator for Meteorology. Federal Meteorological Handbook No. 1 (FMH-1), “Surface Weather Observations and Reports”. Fifth ed., December 1995.
Paakki, J. Attribute grammar paradigms—a high-level methodology in language implementation. ACM Computing Surveys, 27(2) (1995) 196–255.
S-exp-based XML parsing, query, conversion. A SourceForge Project. http://ssax.sourceforge.net/
Serrano, M. Bigloo Scheme implementation. July 2003. http://www-sop.inria.fr/mimosa/fp/Bigloo/bigloo.html
Sitaram, D. pregexp: Portable Regular Expressions for Scheme and Common Lisp. Version 1e9. February 5, 2003. http://www.ccs.neu.edu/home/dorai/pregexp/pregexp.html
Swierstra, S.D. Combinator parsers: From toys to tools. Proc. 2000 ACM SIGPLAN Haskell Workshop, Electronic Notes in Theoretical Computer Science, volume 41.1, August 2001.
World Wide Web Consortium. XML Path Language (XPath). Version 1.0. W3C Recommendation. November 16, 1999. http://www.w3.org/TR/xpath
World Wide Web Consortium. XSL Transformations (XSLT). Version 1.0. W3C Recommendation. November 16, 1999. http://www.w3.org/TR/xslt
Author information
Authors and Affiliations
Corresponding author
Additional information
This is an extended version of a paper presented at the Workshop on Scheme and Functional Programming 2000, sponsored by ACM SIGPLAN. September 17, 2000. Montreal, Canada.
Rights and permissions
About this article
Cite this article
Kiselyov, O. Implementing Metcast in Scheme. Higher-Order Symb Comput 18, 355–370 (2005). https://doi.org/10.1007/s10990-005-4880-9
Issue Date:
DOI: https://doi.org/10.1007/s10990-005-4880-9