image/svg+xml

Hiphop.js / Lang

version 0.3.0

.keep

HipHop is a DSL embedded in the HopScript language. HipHop modules must contain the following header declaration:

"use hiphop"

The HipHop syntax extends the JavaScript syntax with one single expression rule:

  hiphop <HHstatement>

Its complete formal syntax is given in Section Formal Syntax. Once defined, a HipHop program must be loaded into a HipHop reactive machine that can execute this program by running reactions.

Example

abro.js

"use hiphop"
"use hopscript"

const hh = require( "hiphop" );

hiphop module prg( in A, in B, in R, out O ) {
   do {
      fork {
         await( A.now );
      } par {
         await( B.now );
      }
      emit O();
   } every( R.now )
}

exports.prg = new hh.ReactiveMachine( prg, "ABRO" );

Table of Contents