/
Design doc: JS + Tuplespace
Design doc: JS + Tuplespace
Mike Stay
2018-10-11
This document is still very much a placeholder draft.
JS tuplespace Use Babel to introduce new syntax key <identifier>; translates to let <identifier> = new Key(); where class Key { constructor() { // use protobuf to get new internal id from CPRNG } combineWith(...keys) { // use protobufs to form [this.id, ...keys.map(_ => _.id)] } get r { // use protobuf to form bundle-{this.id} // How to return the proper key safely without // exposing the ability to forge names to users? // Delete constructor property on new instances? } get w { // use protobuf to form bundle+{this.id} } get o { // use protobuf to form bundle0{this.id} } bang(json, nonlinear) { // convert JSON to RÇON // produce into tuplespace } fork(pattern, closure, nonlinear) { // closure is only provided if serialization succeeds (see below) // consume from tuplespace } } <keyID>!(JSON with keys) translates to key.bang(JSON, false) <keyID>!!(JSON with keys) translates to key.bang(JSON, true) // Fork semantics. Primitives have built-in serialization. // Runtime error if free var is not serializable. // Matches go to microtask queue. // Patterns are JSON with keys and free vars. for(<pattern> <- <key>) fork { <statements> } translates to key.fork(pattern, closure, false) for(<pattern> <= <key>) fork { <statements> } translates to key.fork(pattern, closure, true) Closure is an AST for the statements and an environment map from free vars to their serialized values. Translated pattern is an AST?
Related content
Project Planning Feb 8th, 2018
Project Planning Feb 8th, 2018
More like this
Tuplespace Notes
Tuplespace Notes
More like this
Project Planning March 21st, 2018
Project Planning March 21st, 2018
More like this
2019-05-07 Meeting notes: bloat in the tuplespace
2019-05-07 Meeting notes: bloat in the tuplespace
More like this
Powerbox and Foreign Function Interface
Powerbox and Foreign Function Interface
More like this
2018-02-20 Meeting notes: Plans for implementation of RChain API using JSON
2018-02-20 Meeting notes: Plans for implementation of RChain API using JSON
More like this