Stream: ideas

Topic: running tasks in the repl


view this post on Zulip Richard Feldman (May 25 2024 at 11:59):

some of us talked about this idea at Software You Can Love in Milan: we could allow running tasks in roc repl

view this post on Zulip Richard Feldman (May 25 2024 at 12:00):

for example, you could write at the prompt:

» File.writeUtf8! path contents

...and it would do that

view this post on Zulip Richard Feldman (May 25 2024 at 12:00):

the rule would be that you'd have to actually use the ! suffix to indicate that you really want to run the effect

view this post on Zulip Richard Feldman (May 25 2024 at 12:01):

and we'd infer the platform based on the main.roc application (or platform) in the current dir where you launched the repl

view this post on Zulip Richard Feldman (May 25 2024 at 12:01):

(configurable via cli arg)

view this post on Zulip Brendan Hansknecht (May 25 2024 at 13:19):

Intriguing. How would we ensure effects only run once and deal with linking? I think the current repl just builds up one long file and runs everything

view this post on Zulip Agus Zubiaga (May 25 2024 at 13:22):

Yeah, I was thinking about that on the plane. We would somehow have to replace the def’s expression with the result, but I don’t think we can really do that. It could include pointers that won’t work on the next run.

view this post on Zulip Norbert Hajagos (May 25 2024 at 15:34):

The idea is really good and I like it. Would packages defined in main be allowed just like how the platform is infered?

view this post on Zulip Agus Zubiaga (May 25 2024 at 19:16):

Yeah, we should do that separately. That doesn’t require any major changes to the repl.


Last updated: Jun 16 2026 at 16:19 UTC