Table of Contents
Getting HipHop.js
NPM Installation
npm install https://www-sop.inria.fr/members/Manuel.Serrano/software/npmx/hiphop.tgz
When HipHop is officially released, the installation procedure is:
npm install @hop/hiphop
To test HipHop
(cd node_modules/@hop/hiphop; npm install --save-dev; npm test)
To run a program:
cat > prog.hh.js <<EOF
import { ReactiveMachine } from "@hop/hiphop";
hiphop prog() {
host { console.log("please, wake me up..."); }
yield;
host { console.log("thanks!"); }
}
const m = new ReactiveMachine(prog);
m.react();
m.react();
EOF
nodejs --enable-source-maps --no-warnings --loader ./node_modules/@hop/hiphop/lib/hiphop-loader.mjs prog.hh.js
NPM Update
Until HipHop is officially available on the NPM repository, HipHop updates require manual operations.
- First, clean up NPM cache with:
npm cache clean --force
. - Remove the files
package.json
andpackage-lock.json
in the current directory and in the parent directories. - Remove the directories
node_modules
in the current directory and in the parent directories.
Of course, proceed to step 2 and 3, if and only if these directories contain only HipHop sources. Do not remove any of these files and directories if they contain other resources!
Installing from the Sources
HipHop needs to be installed in a prepared directory in which its two
dependencies, hopc
and readlines
are already installed:
mkdir project
cd project
mkdir download
(cd download; wget https://www-sop.inria.fr/members/Manuel.Serrano/software/npmx/hopc.tgz)
(cd download; wget https://www-sop.inria.fr/members/Manuel.Serrano/software/npmx/readlines.tgz)
mkdir -p node_modules/@hop
(cd node_modules/@hop; tar xvfz ../download/hopc.tgz)
(cd node_modules/@hop; tar xvfz ../download/readlines.tgz)
Then, to install HipHop:
(cd download; wget https://www-sop.inria.fr/members/Manuel.Serrano/software/npmx/hiphop.tgz)
(cd node_modules/@hop; tar xvfz ../download/hiphop.tgz)
Installing from git
Install the HipHop dependencies as for a source file installation
Then, to install HipHop:
(cd node_modules/@hop; git clone https://github.com/manuel-serrano/hiphop)