Stream: ideas

Topic: In file evaluation/repl


view this post on Zulip Kilian Vounckx (Nov 20 2026 at 05:53):

Sorry if this or something has already been proposed. It's been a while since I've been on the zulip, and catching up with everything would take more time than I have. (That's a good thing, it means the community is growing!)

Anyways

I really like being able to run a custom function on a few different argument to get a feel for how it works and if it is correct. In many languages (including roc), you can use a repl for this. However, this makes me leave my editor and feels like an unnecessary step. Proof assistants like lean and cocq have a statement/macro like #eval ... and Eval ... respectively, which, on file save, evaluate an expression and show the answer right there in the editor. Uiua has something similar with double comment tokens and the lsp even actually edits the file. I like this more than a repl because it allows me to stay within the file and iterate even quicker. What does everyone think of adding such a feature to roc?

view this post on Zulip Luke Boswell (Nov 20 2026 at 06:07):

You might like https://ageron.github.io/roclet/

view this post on Zulip Luke Boswell (Nov 20 2026 at 06:09):

Roc also has hot reloading by default, so if you pick the right platform this could also be an option--depending on what kind of workflow you're looking for

view this post on Zulip Kilian Vounckx (Nov 20 2026 at 06:26):

Luke Boswell said:

You might like https://ageron.github.io/roclet/

Definitely cool concept! I wonder if it is possible to make roc compatible with the jupyter kernel

I'm not leaving nvim however :grimacing:

view this post on Zulip Luke Boswell (Nov 20 2026 at 06:28):

I feel like @Aurélien Geron has done that, or had a proof of concept with a working jupyter thing...

view this post on Zulip Kilian Vounckx (Nov 20 2026 at 06:29):

I just feel something like a top-level dbg statement would be cool. Like when I type dbg 1 + 2, it automatically shows me in the editor (either as a hint, or editing the file like uiua) so it shows 3

I'd find this cool when writing libraries to be able to quickly see outputs before writing proper tests
Also for advent of code or other puzzles of course :laughing:

view this post on Zulip Kilian Vounckx (Nov 20 2026 at 06:29):

Luke Boswell said:

I feel like Aurélien Geron has done that, or had a proof of concept with a working jupyter thing...

Cool! It's gonna be hard to beat jupyter for features and adoption

view this post on Zulip Luke Boswell (Nov 20 2026 at 06:29):

Kilian Vounckx said:

Sorry if this or something has already been proposed. It's been a while since I've been on the zulip, and catching up with everything would take more time than I have

This isn't specifically for you @Kilian Vounckx ... but if anyone isn't aware there is https://github.com/roc-lang/zulip-export and I often find it helpful for searching through older topics and finding things. I find a cheap and fast LLM can be super quick way to index that and drill straight to the topics I want.

view this post on Zulip Luke Boswell (Nov 20 2026 at 06:30):

You could write a top-level expect couldn't you?

view this post on Zulip Luke Boswell (Nov 20 2026 at 06:31):

Like make one that intentionally fails...

expect {
  dbg thing
  Bool.False
}

view this post on Zulip Luke Boswell (Nov 20 2026 at 06:31):

I think you could use roc test --watch and the debug will show up right away.

view this post on Zulip Luke Boswell (Nov 20 2026 at 06:32):

If you try that and it works.. we should think about documenting it somewhere for others

view this post on Zulip Kilian Vounckx (Nov 20 2026 at 06:33):

That's pretty nice already, and I'll try it. but I like if it's just in the editor, not even a separate tab or window, just next to the expression

view this post on Zulip Kilian Vounckx (Nov 20 2026 at 06:33):

Thanks for the export! Definitely handy for the next time i have a question

view this post on Zulip Luke Boswell (Nov 20 2026 at 06:35):

Screenshot 2026-11-20 at 17.35.08.png

view this post on Zulip Kilian Vounckx (Nov 20 2026 at 06:49):

At first sight, I don't like that it takes up half the screen, but I'll give it a proper try later today to see the workflow

view this post on Zulip notramo (Nov 20 2026 at 11:03):

Maybe the LSP could print the comptime-computed values of top level constants in the hover info, alongside the type?


Last updated: Nov 26 2026 at 20:35 UTC