Stream: ideas

Topic: RocValue Formatting


view this post on Zulip Luke Boswell (Feb 08 2026 at 09:59):

I am wondering if we should introduce a new module maybe src/values/ similar to src/types/ in a way, where we define RocValue types and implement common functionality like formatting.

I started looking at upgrading the REPL snapshots to also run using the dev backends, to increase our coverage using the existing setup etc. However, the first issue I've ran across is that we have at least three different places where we currently format a Roc value.

  1. render_helpers.zig
  2. helpers.zig
  3. eval.zig

None of these have complete coverage for all the values, and we see different formatting between the REPL, snapshots, interpreter etc.

If we used these RocValue types more consistently internally that might help with roc glue and roc tooling as well in future as we have FFI friendly types with utilities like formatting for our RocValue's.

Maybe we already have something like this laying around we could re-use.

view this post on Zulip Richard Feldman (Feb 08 2026 at 12:14):

that makes sense to me! :+1:

view this post on Zulip Richard Feldman (Feb 08 2026 at 12:15):

I think the repl one is probably the most featureful - I think it's the only one the respects custom inspect


Last updated: Jun 16 2026 at 16:19 UTC