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?
You might like https://ageron.github.io/roclet/
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
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:
I feel like @Aurélien Geron has done that, or had a proof of concept with a working jupyter thing...
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:
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
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.
You could write a top-level expect couldn't you?
Like make one that intentionally fails...
expect {
dbg thing
Bool.False
}
I think you could use roc test --watch and the debug will show up right away.
If you try that and it works.. we should think about documenting it somewhere for others
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
Thanks for the export! Definitely handy for the next time i have a question
![]()
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
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