Entry #7: Building Server-Side Web Language Processors

“Building Server-Side Web Language Processors” is an article written by Ariel Ortiz, who is my professor during the Compilers Design course. The article talks about the advantages of building a language processor that actually runs on the web, instead of a processor that just runs on a command-line shell.

Creating a web language processor can be a great challenge, as it requires to have knowledge in: Compilers design, Web server creation, Front-end design, and Security Management. The strategy used by the author consists of programming a web server from scratch and should be able to serve static resources and host a language processor that generates dynamic content based on the input and send the result to the client. 

The implementation uses JavaServer Pages, which allows the processor to use custom tags, that are evaluated and produce an output. One of the advantages of this implementation is that the language processor has access to all the facilities provided by the hosting environment like headers, cookies and request parameters. However, it has the disadvantage that everything in the HTTP protocol has to be explicitly dealt with.

Some strategies to build a web language processor according to the author are: 
  • Use the Common Gateway Interface: CGI was the first technique available for generating dynamic content in the World-Wide-Web since 1993.
  • Build Over an Existing Web Technology: The main advantage of this strategy is that the web language processor has access to all the facilities provided by the hosting environment.
  • Program Your Own Web Server: This strategy consists of programming a web server from scratch. The web server should be able to serve static resources, but, the main function of it should be to host a language processor that allows generating dynamic content.

The author concludes that his students enjoyed this approach, but because of the complexity of the task, only high semester students can fully understand it and get involved with the course. Building a compiler can be difficult, without the proper guidance and previous knowledge, but, with a good teacher and a well-defined toolset can make it an entertaining and enjoyable challenge.

Article: Ortiz, A. (2010). Building Server-Side Web Language Processors. Recovered from http://34.212.143.74/publicaciones/weblang.pdf

Comentarios

Entradas populares de este blog

Entry #4: Internals of GCC

Entry #2: Making Compiler Design Relevant for Students