Mario Latendresse. A persistent web application for distribution of weather information in Scheme, in International Lisp Conference, Oct 2002.
For several years, the Navy has used scheme to build a web application for the distribution of real-time weather information for mission plannings. This application, called Metcast, is composed of meteorological bulletin decoders and a web server accessible around the world. The decoders populate several databases of real-time weather observation reports, forecasts, satellite images and gridded data produced by weather models. The requests to Metcast are formulated in a simple language, it’s syntax being s-expressions. The responses are returned as either binary data or XML.
Recently the Metcast server was modified to run under the fast CGI model of Apache. This module contains a pool of persistent web application instances, each capable of answering multiple requests, this persistency increases throughput by avoiding multiple process creations, start up delay and read reconnection to database servers.
A new tool is being used to generate lexical parsers in Scheme. It is based on a cascade of lexers, described by tagged regular expressions (TREs) written as s-expressions. In Metcast, these lexical parsers are used to generate meteorological decoders. We advocate TREs, instead of Perl style regular expressions, as they can do complex lexical parsings by generating parse trees which Lisp like languages can easily manipulate. We present the latest Metcast architecture and the technical details of the integration of Scheme with other fundamental Unix tools. We argue that the Metcast implementation, using Scheme, is highly portable and could not have been accepted by the Navy if it were not for it’s full integration with common Unix tools. We also pinpoint some basic functionalities unavailable in the Scheme standard (R5RS) but for which our web application could not function properly and efficiently.