dyne / restroom-mw

🛠 Easy REST API builder executing Zencode
https://restroom.dyne.org
GNU Affero General Public License v3.0
3 stars 11 forks source link

REPL for Zenroom #245

Closed benkoo closed 1 year ago

benkoo commented 1 year ago

I wonder if there is a REPL(Read-Evaulate-Print Loop) library or design pattern designed for Zenroom? Otherwise, it might be useful to build one using the node-REPL (https://nodejs.org/api/repl.html) to help other developers to build front ends for Zenroom/RESTroom.

puria commented 1 year ago

Ciao thanks! Yes zenroom cli without any argument is a repl 👍

benkoo commented 1 year ago

Thanks for the most speedy reply. I imagine that "RESTROOM" might already been using node-REPL? I have to check.

puria commented 1 year ago

@benkoo Not really, that uses internal ABI's via transpiled WASM. But as a REPL you want to use the binary CLI available on the https://github.com/dyne/Zenroom repo. Run it as zenroom -z for playing with zencode and zenroom only for the Lua calls docs available on https://dev.zenroom.org/#/pages/zencode-cookbook-intro?id=use-zenroom-by-command-line-cli

But many people now days find it more easy to play on https://apiroom.net for prototype and debug interactively so you can also export the result directly in a working restroom-mw instance.

BTW about the restroom architecture that are just express middleware that executes contracts and exposed on restful-like endpoints. You can find more on https://dyne.org/restroom-mw/#/architecture

jaromil commented 1 year ago

@puria rlwrap | zenroom -i is a comfortable repl for the Lua dialect.

we do not have yet a repl for zencode

puria commented 1 year ago

@jaromil 😍 awesome more precise answer!

jaromil commented 1 year ago

@puria well, I made a mistake, no pipe needed

rlwrap zenroom -i