This folder contains all the bindings for languages other than C
.
The new recommended way to make Zenroom bindinds is to spawn an execution process of the zencode-exec
binary, then call it passing it all arguments from an input stream (stdin
) encoded as base64
.
In brief such a shell command:
cat zencode-data-keys-conf | zencode-exec
The zencode-data-keys-conf
is a file or stream with a newline separated list of base64 encoded inputs (except the initial conf
line) which has to be in this order:
- conf (string) newline
- zencode script (string -> base64) newline
- keys (json -> base64) newline
- data (json -> base64) newline
- extra (json -> base64) newline
- context (json -> base64) newline
Each line should start directly with the base64 string without any prefix and should end with a newline.
Empty lines can be a newline (or CRLF) and will be skipped, but should never be omitted: the zencode-exec expects 6 input lines in total, not less, including empty ones, all newline terminated.
This executes and returns two streams:
stdout
with thejson
formatted results of the executionstderr
with ajson
formatted array as log of events
The log of events is a simple array sorted in chronological order, the nature of the events can be detected by parsing the first 3 chars of each entry (or just the second most significant char):
[*]
is a notification of success.
is execution information[W]
is a warning[!]
is a fatal error[D]
is a verbose debug information when switched on with confdebug=3
+1
and other decimal numbers indicate the Zencode line being executed-1
and other decimal numbers indicate the Zencode line being ignored
It is also worth noting that zencode-exec
utility will dump the HEAP and TRACE on errors and on debug requests on one single line using JSON format encoded as base64, i.e:
. HEAP: (base64 -> json)
. TRACE: (base64 -> json)
This should ease the task of the calling application to show the status of the execution and of the HEAP inside the VM, in case for instance of a debugging session.