Let’s “HOP” to web 2.0

Hop is a new higher-order language designed for programming interactive web applications (mostly small-to-medium sized) such as web agendas, music players, etc.

A dual language

Hop is a stratified language. The first stratum, which is in charge of executing the logic of an application, is dedicated to programming the main engines or the servers while the second stratum, which is in charge of executing the graphical user interface, is dedicated to programming the clients. A single program file of Hop contains instructions for both the server and the client. But the two strata have different facilities. The main stratum provides an API for accessing the file system and the resources of the computer but it can’t handle graphical user interfaces while the GUI stratum is dedicated to dealing with graphical interactions but it has strictly restricted access to the resources of the computer it executes on. Once the program starts, the server and the clients continuously communicate by implementing the exchanges with function calls and event loops. Let us take the musical player with Hop for an example. On the client, it continuously displays the elapsed time of the songs that are played on the server.

A Scheme-like language

Different from a markup document like HTML, Hop is a programming language. It is based on the Scheme algorithmic programming language and it has some extensions. It supports object-oriented programming, exceptions, modules and multi-threading. It has various tools and libraries. Apart from these functionalities that a programming language normally have, Hop supports original constructions specially designed for programming web applications. For example, the function with-hop:

(with-hop (service arg0 …)

[(lambda (h) …success expression…)

[(lambda (h) …failure expression…)]])

is a special function that delegates work to the server and takes two parameters. The first parameter contains the request the client should send to the server asynchronously. The second parameter contains the callback function that the client should invoke when the response arrives from the server. Lambda is an anonymous function which is also supported by Hop.

Conclusion and future work

Hop is a new language for programming web applications. It relies on two strata, the server and the client. It supports management of communications from both server and client side. But as demonstrated in [1], it has some security problems and some difficulties handling network failure, etc. These are the things that should come under consideration along with the development of Hop.


[1] Slide: “Hop, a language for programming the web 2.0” https://www.slideshare.net/IMDS2014/hop-a-language-for-programming-the-web-20

[2] Manuel Serrano, Erick Gallesio, Florian Loitsch — Hop, a language for programming the web 2.0 OOPSLA’06 October 22–26, 2006, Portland, Oregon, USA

Show your support

Clapping shows how much you appreciated WANG CHUAN’s story.