A single gateaas instance is a single boolean logic gate micro service.
A cluster of gateaas instances can represent extremely complex machines.
Theoretically you can emulate a processor if you try hard enough.
First build the docker container
docker build -t gateaas:1.0.0 .Next, invoke the gateaas-compiler to output a docker-compose file.
The following invocation will "compile" my-boolean-logic-script.gas and generate docker-compose.yml.
gateaas-compiler my-boolean-logic-script.gas my-boolean-logic-cluster.yml
Next, launch the gate cluster
docker-compose -f my-boolean-logic-cluster.yml
From here, you can look inside the my-boolean-logic-cluster.yml to determine where to access your gates.
A gate may be probed via curl http://my-gate/probe
A gate accepts input via curl http://my-gate/in/$inputNumber -d $bool
$inputNumberrepresents the pin being set. Unary gates (NOOP, NOT) will always use input 0. Binary gates will use 0 or 1.$boolrepresents the value the pin is being set to. Accepts 0, 1, true, false
See examples for what is possible
Only source installation is supported right now. Get your local haskell env set up using ghcup and then run cabal install gateaas-compiler
Declarations
INPUT adeclares that there will be some program inputaLET foo = bardeclares that there will be some expressionbarassigned to valuefooOUTPUT foo = bardeclares that there will be some expressionbarassigned tofoo, and that nothing is allowed to reference foo. In future versions, outputs and input declarations will be leveraged to demonstrate the bits moving.
Functions
a AND ba NAND ba OR ba NOR ba XOR ba XNOR bNOT a
Parens may be used to explicitly define order of operations. What is the default order of operations? I dunno, and it will likely change. Use parens