Stream: contributing

Topic: roc-cli REPL


view this post on Zulip Luke Boswell (Aug 24 2025 at 11:27):

@EnDeRBeaT I spent some time thinking about the repl with Claude and looking at our existing design.

Here's a rough design doc https://gist.github.com/lukewilliamboswell/ffe31020bda636d879180ac3b0bd1608

Does something like this help you? I could also spend some time with you throwing ideas around or talking about the codebase if you'd like.

view this post on Zulip EnDeRBeaT (Aug 24 2025 at 12:28):

Nice! I will start in the evening or on tomorrow's evening and come back with questions if I need to

view this post on Zulip EnDeRBeaT (Aug 25 2025 at 20:14):

Hi, from build.zig, I can't see where to add a dependency module from vaxis lib, can you point it out?

view this post on Zulip Brendan Hansknecht (Aug 26 2025 at 00:18):

Normally deps are added in the build.zig.zon. Then referenced in build.zig.

view this post on Zulip Brendan Hansknecht (Aug 26 2025 at 00:19):

You can look at bytebox or zstd as examples

view this post on Zulip Luke Boswell (Aug 26 2025 at 00:47):

@EnDeRBeaT our build system can be a little confusing as there's a lot going on. I made a start and wired everything up for you in this branch https://github.com/lukewilliamboswell/roc/tree/cli-repl

view this post on Zulip Luke Boswell (Aug 26 2025 at 00:47):

It's wired into zig build roc and zig build test so you can focus on the functionality and leave wrestling with the build system for later :smiley:

view this post on Zulip EnDeRBeaT (Aug 27 2025 at 18:18):

I was wondering on why we are using vaxis for this? What is the goal look for the cli? I have only seen repls like pyhton's, which can be implemented with basic console i/o.

view this post on Zulip EnDeRBeaT (Aug 27 2025 at 18:44):

okay nevermind, i am stupid

view this post on Zulip Luke Boswell (Aug 27 2025 at 22:50):

Not stupid, I had the same thought process I think.

I actually implemented the cli Repl as a proof of concept a while back but found myself hand rolling all these tui like things for handling input reliably etc. I raised the idea of using a more mature and well tested library and that seemed to be a better direction to try.

We may find vaxis is too much. Loris mentioned there is a lower level API within vaxis that we might consider using, if we don't want/need the higher level abstraction.

Thank you for exploring this, I think the repl will be really useful and being built into the cli will make it easy to use.

view this post on Zulip Anthony Bullard (Aug 28 2025 at 00:04):

i thought we wanted to keep the compiler dependency-free?

view this post on Zulip Luke Boswell (Aug 28 2025 at 08:13):

I couldn't resist a diagram... :grinning_face_with_smiling_eyes:

Screenshot 2025-08-28 at 18.11.20.png

I think we should aim for no dependencies in the compiler stages (unless absolutely necessary for some reason). But the tools, like cli or playground VM could use some.

view this post on Zulip EnDeRBeaT (Aug 28 2025 at 19:29):

It feels like making a python-like with Vaxis is kinda cumbersome: you can't really have just a shell with repl like input without handrolling everything except the input.

However, it is pretty easy to recreate the same design as in roc playground repl. However, it is an unorthodox design. What do you guys thing?

view this post on Zulip Luke Boswell (Aug 29 2025 at 00:34):

We're all about taking the not so easy path here in roc land -- if it means delivering a nice experience for our users. :smiley:

I'm not really sure what you are specifically talking about though... could you give me an example maybe?

view this post on Zulip EnDeRBeaT (Aug 29 2025 at 05:26):

Luke Boswell said:

could you give me an example maybe?

Sure, the basic REPL has the same UX as a CLI, you have the same bindings, the same history mechanism, you enter commands, you get output (which you can cancel with ^C). In libvaxis it is quite difficult to replicate such workflow: there are separate widgets for scrolling text and input, but composing them together looks like a challenge (however, might not be as difficult as i thought)

The design of playground repl is a scroll window + text input, which is also easy to replicate in libvaxis


Last updated: Sep 08 2025 at 12:16 UTC