Building Server-Side Web Language Processors

Decades ago thinking on having a language processor running on the web was just a dream.

From time to here, more and more individuals have change from building standalone programs to building web-based applications.

But, why consider a web approach?
There are 2 main reasons to consider it(1):

  1. Curriculum organizing principles. Which also has 2 approaches:
    1. A compressed approach: for institutions that need to reduce the number of intermediate courses, so they combine individual topics into thematic courses that integrate material from related area.
    2. A web-based approach: this model has had an important growth, since the popularity of the Internet and the World-Wide-Web.
  2. It is relevant and appealing to our students: Many of the students will become professional web developers. Also: "web programming promotes diversity in computer science because the programs are more motivating to a diverse audience".
Some general background:

A programming language processor (1) is " any system that manipulates programs expressed in some particular programming language. Language processors allow us to run programs, or prepare them to be run”

The world wide web is a client-server architecture(1). So there is two different physical locations in which a web language processor can run:

  • Client-side language processors: these run within a user-agent- or a web server.
  • Server-side language processors: These run on the server computer and somehow interact with a web server.
HTML?, how does it work?

Hypertext Transfer Protocol which is a request/response standard between a client and a server(1). This works like the following:

  • An HTTP client initiates a request by establishing a Transmission Control Protocol (TCP) connection to a particular port on a host computer. 
  • An HTTP server listening on that port waits for the client to send a request message. Upon receiving the request, the server sends back a response. This response can be the contents of a static file (like an image or an HTML page), or it can be a dynamically generated resource produced by a web language processor.
Fun and useful fact:
Popular scanner and parser generator tools (like lex and yacc) can be used to build a CGI-based language processor which can be invoked by a web server, such as the Apache HTTP server [1].

But what strategy should we follow?

There are 3 implementation Strategies (1):

  1. CGI (Common Gateway Interface) which is a simple interface for running external programs under a web server in a platform-independent manner.
  2. Building over an existing web technology: For example, JavaServer Pages allow defining custom tags. The body of a custom tag can be any text, including the source code for an arbitrary programming language.
  3. -Programming your own web server: This implementation strategy consists of programming a web server from scratch. The web server should be able to serve static resources, but its main function is to host a language processor that allows generating dynamic content.
It's really important and useful to implement a web-based approach involving language design, that show us the convergence technology an computer systems have. Knowing about this different approach grant us with more tools and should be taking into account.

References:
1.-http://34.212.143.74/publicaciones/weblang.pdf


Comentarios

Entradas populares