@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.
Nice! I will start in the evening or on tomorrow's evening and come back with questions if I need to
Hi, from build.zig
, I can't see where to add a dependency module from vaxis lib, can you point it out?
Normally deps are added in the build.zig.zon. Then referenced in build.zig.
You can look at bytebox or zstd as examples
@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
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:
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.
okay nevermind, i am stupid
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.
i thought we wanted to keep the compiler dependency-free?
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.
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?
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?
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