MOVED TO https://github.com/Picolab/pico-engine/tree/master/packages/pico-engine
An implementation of the pico-engine hosted on node.js
You'll need node.js v4 or later.
- Windows - use the installer at nodejs.org
- Mac - use the installer at nodejs.org or use n bash script
- Linux - we recommend the n bash script which will allow you to easily install and switch between node versions.
Once you have node installed, use npm to install the pico-engine
;
$ npm install -g pico-engine
Now your system has a new command called pico-engine
.
To start the engine simply run this command
$ pico-engine
http://localhost:8080
Copy the url into a browser and see the UI.
The first time you run the system it will create a root Pico and install two rulesets.
There are two rulesets used by all Picos:
io.picolabs.pico
is used by each Pico to keep track of itself and its childrenio.picolabs.visual_params
is used by each Pico to keep track of it in the My Picos page
With the rulesets installed, you can drag the rounded rectangle of your Pico and drop it wherever you want it. In its "About" tab (click on it to reveal the tabs) you can change its display name and color.
Also in the "About" tab, you can add and delete child Picos.
In the "Rulesets" tab you can see the information held for your Pico by each of its rulesets. By clicking on a ruleset id, you will be taken to the Engine Rulesets page where you can see its source code.
To make your own ruleset, write your code in the box in the Engine Rulesets page. Use the "validate" button until the code compiles. Then use the "register" button to register this version of your code with the engine.
The server is configured via some environment variables.
PORT
- what port the http server should listen on. By default it's8080
PICO_ENGINE_HOME
- where the database and other files should be stored. By default it's~/.pico-engine/
The pico-engine
is made up of several smaller modules. Each with their own documentation and test suite.
- pico-engine-core - executes compiled KRL
- krl-stdlib - standard library for KRL
- krl-compiler - compiles AST into a JavaScript module
- krl-parser - parses KRL to produce an abstract syntax tree (AST)
- krl-generator - generates KRL from an AST (pretty-printer)
To run the pico-engine in development mode do the following:
$ git clone https://github.com/Picolab/node-pico-engine.git
$ cd node-pico-engine
$ npm install
$ npm start
That will start the server and run the test. Anytime you make a change in the src/
folder it will restart the server and re-run the tests.
NOTE: When running via npm start
the PICO_ENGINE_HOME
will default to your current directory i.e. your clone of this repository.
To view details about versions: CHANGELOG.md
MIT