image/svg+xml

Hiphop.js

version 0.3.0

.keep

HipHop.js: Synchronous Multitier JavaScript Reactive Programming

HipHop.js is an Hop.js DLS for orchestrating web applications. HipHop.js helps programming and maintaining Web applications where the orchestration of asynchronous tasks is complex.

How to use it?

Pretty simple:

You are now ready.

Example

Here is a seminal example of synchronous programming languages. This program simulates a machine that has three input buttons. It waits for buttons A and B to be clicked before emitting the signal "O". The machine is reset when button "R" is pressed, whatever its current state.

"use hiphop";

service abro() {
   return <html>
     <head>
       <script src="hiphop" lang="hopscript"/>
       <script defer>
          hiphop machine prg( in A, in B, in R, out O ) {
             do {
                fork {
                   await( A.now );
                } par {
                   await( B.now );
                }
                emit O();
             } every( R.now )
          }
   
          prg.addEventListener( "O", v => alert( "got O: " + v ) );
       </script>
     </head>
     <body>
       <button onclick=~{prg.react( "A" )}>A</button>
       <button onclick=~{prg.react( "B" )}>B</button>
       <button onclick=~{prg.react( "R" )}>R</button>
     </body>
   </html>
}