Repl and playground
You might want to explore Derw in an interactive fashion, and for that there's two tools that are handy: the repl, and the playground.
Repl
To access the repl, simply run derw repl
.
In the repl, you can enter definitions for imports, types, functions and consts. They will not be evaluated until you use :run
or :show
. Between each definition, you should enter a blank newline so that it will be parsed. If parsed successfully, the repl will inform you - and if not, it will show you any errors.
:run
run will evaluate functions and constants
:show
show will first evaluate the current repl body, then print the value of the named value provided
:eval
eval can be used to run some Derw code without needing a definition
:help
And if you forget all the above, you can use help to get a reminder
Playground
The playground currently lets you write Derw code, and see the outputted code in any of the target languages. Later on error messages will be added, along with the ability to import packages and run code in the browser.
Last updated