Skip to content

Livecoding

tim-hardcastle edited this page Jul 30, 2024 · 1 revision

"Livecoding" means that when you talk to a Pipefish service in the REPL, if its source code has been changed since last you interacted with it, the service will automatically be re-initialized with the new code. (This also works if you change an import, or an import of an import, etc, or the code of another Pipefish service on which your service depends.)

So if you also have autosave turned on in your editor (as we strongly recommend), then changes in your code will propagate through to the service without you needing to do anything. Try it out! If you're still running the service from the previous section, change Hello to Goodbye in the script, and then in the REPL we get:

#0 → greet
What's your name? Horace
Goodbye Horace!
#0 → 

Livecoding can be turned on and off with hub live on and hub live off.

Between the REPL and livecoding, it is very easy to just casually mess around with Pipefish and we recommend that you do so as you follow through this manual.

Clone this wiki locally