HipHop
HipHop is a new language layer within Hop dedicated to request and event orchestration. HipHop follows the synchronous reactive model of the Esterel and ReactiveC languages, originally developed for embedded systems programming. It is based on synchronous concurrency and preemption primitives, which are known to be key components for the modular design of complex temporal behaviors. Although the language is concurrent, the generated code is purely sequential and thread-free; HipHop is translated to Hop for the server side and to straight JavaScript for the client side.
HipHop has been presented at the PLASTIC'11 [1] workshop. The paper is available here.
[1] | Programming Language And Systems Technologies for Internet Clients. |
Motivation
As the Web is asynchronous, all Hop applications we wrote deals with asynchronous events. For a while, the callback model has been used to easily write condition-action behaviors:
When the user clicks this button, then request more content to the server, or when the request completes, then add the request's response in the DOM element whose `id' is `extra-content'.
However, the callback model does not easily permits to combine multiple conditions before issuing an action. For instance, a common pattern we see in our programs is to request two different resources to remote servers, then wait for the both request to complete before starting an animation. Each request callback must know the other in order to take the decision to start the animation, requiring some global state to count how many request have completed. The callback model forces us to write an automaton to manage the request states.
It becomes worse when we want to add a third request to this pattern, as it requires to change the code at several places to extend the automaton. Error detection and recovering is tricky to achieve, as well as cancellation. The code size grows exponentially with the number of asynchronous events to manage.
As a consequence, code maintenance is difficult, and checking the correctness of a program is hard.
We developed HipHop, a extension that adds a new dimension to Hop: the sophisticated handling of events based on synchronous reactive programming event-handling and concurrency programming primitives inspired by the Esterel and ReactiveC languages. Synchronous reactive programming has become classical in the circuit design and real-time programming areas, where concurrency is ubiquitous and event handling is a crucial concern. It has many industrial implementations in embedded systems such as airplane, train, or plant control, as well as complex HMIs such as airplane cockpits.
More information
This page presents the core language of HipHop, it is currently under development and will be updated in the coming couple of weeks.
HipHop is written as a standalone Hop library. The source code is not publicly available yet, but you can ask for a copy.
Contacts
Cyprien.Nicolas AT inria.fr
Return to Top
Page last modified Sat May 25 09:56:47 2013.