Zenroom icon indicating copy to clipboard operation
Zenroom copied to clipboard

Feat/introspection

Open jaromil opened this issue 2 years ago • 4 comments

Improve the introspection capabilities of Zenroom to list all statements, tokens and stats connected, as well cleanup the init to narrow down strictly necessary scenarios. At last implement Norvig's autocorrection on detected tokens.

jaromil avatar Nov 30 '23 10:11 jaromil

List of Zencode Scenarios to be loaded by default

D + load: given D + load: foreach D + load: verify D + load: when D + load: then

D + load: table D + load: dictionary D + load: random D + load: keyring D + load: debug D + load: array

  • load: ethereum
  • load: eddsa
  • load: secshare
  • load: schnorr
  • load: ecdh
  • load: qp
  • load: hash
  • load: pvss
  • load: w3c
  • load: bitcoin
  • load: petition
  • load: pack
  • load: credential
  • load: planetmint
  • load: reflow
  • load: http
  • load: bbs
  • load: dp3t
  • load: p256

jaromil avatar Nov 30 '23 10:11 jaromil

Most frequent tokens (occurring 5 or more times)

image

jaromil avatar Nov 30 '23 11:11 jaromil

Looking at this PR I got an idea, can we also create an API that list all statements divided by Given, When, Then, If and Foreach (maybe also all Rules) and then wrap it into js? This will help to automatize the autocompletion for the editor we are working on. Any thoughts on this?

matteo-cristino avatar Sep 10 '24 07:09 matteo-cristino

@matteo-cristino 😘

puria avatar Sep 10 '24 08:09 puria

TODO: create a zenroom standalone API introspection call to retrieve all zencode statements in JSON.

jaromil avatar Jan 07 '25 16:01 jaromil

Add the possibility to pass a scenario to zencode_get_statements

matteo-cristino avatar Jan 22 '25 10:01 matteo-cristino

Regarding

Looking at this PR I got an idea, can we also create an API that list all statements divided by Given, When, Then, If and Foreach (maybe also all Rules) and then wrap it into js? This will help to automatize the autocompletion for the editor we are working on. Any thoughts on this?

This has been implemented, unfortunately Rule does not seem so simple to extract since they are hidden in ZEN:begin() function, but since they are not that many of them and they change very rarelly we could hardcode them in the slangroom autocompletion without too many problem

matteo-cristino avatar Jan 22 '25 18:01 matteo-cristino

happy about how this turned out. Veeery naaiis

jaromil avatar Jan 23 '25 14:01 jaromil