Stream: compiler development

Topic: Inspect


view this post on Zulip Brendan Hansknecht (Jul 05 2023 at 16:59):

Is anyone interested in taking over work on inspect? I currently have defined all of the userland types and proved it can work, but have not done anything on the compiler side:

I think my time is going to be more scattered for a bit and I think it will be more valuable for me to either work on smaller things and/or things that I have a much better understanding of.

view this post on Zulip Brendan Hansknecht (Jul 05 2023 at 17:01):

Also, I guess I could post this in contributing, but not sure how easy/hard it would be for a newer contributor.

view this post on Zulip Ayaz Hafiz (Jul 05 2023 at 20:52):

I think the head tasks (adding the built-in module, performing type inference + obligation checking in the front-end) are relatively straightforward. The auto-derivers and getting dbg to work with this are harder, but I am happy to mentor or guide anyone interested. We also have a bunch of well-scoped PRs for previous efforts in this space (https://github.com/roc-lang/roc/issues/4195, https://github.com/roc-lang/roc/issues/4202)

view this post on Zulip Brendan Hansknecht (Jul 05 2023 at 21:13):

For anyone interested, my current work is on the inspect-testing branch. This Inspect.roc should essentially match the final file that will be added to the builtins. There is also LogFormatter.roc which is probably pretty close to the output we want for dbg to use (though maybe it will want some color or other minor formatting changes).

view this post on Zulip Richard Feldman (Jul 05 2023 at 22:00):

I think dbg might not be that hard because it can be very similar to roc_alloc (except roc_dbg) - so there's something very similar already in the code base

view this post on Zulip Ayaz Hafiz (Jul 05 2023 at 22:04):

I think the tricky thing with dbg will be special-casing the ability resolution and injecting the appropriate calls to the specialized inspect during code generation

view this post on Zulip Richard Feldman (Jul 05 2023 at 22:15):

ah gotcha :+1:

view this post on Zulip Ayaz Hafiz (Jul 14 2023 at 01:15):

@Brendan Hansknecht do we have any working version of this? Should we consider x-posting in #contributing ?

view this post on Zulip Brendan Hansknecht (Jul 14 2023 at 02:47):

We just have the userland code I linked above. It works, but is far from all the work listed in this thread. Yeah, probably should cross post to see if anyone is interested.

view this post on Zulip Richard Feldman (Jul 22 2023 at 14:49):

Brendan Hansknecht said:

I have definitely seen the dbg issues where after x dbgs, crashes

I think we should bump priority on this - not only would having Inspect + roc_dbg (and maybe roc_expect? :thinking:) fix issues like :point_up: , it would also mean that expect and dbg would immediately Just Work on Windows, which would unblock Windows nightlies

in the Detroit Tech Watch Q&A last week, someone was saying "I'm interested in Roc but can't use it because I'm on Windows" - which I realized is currently true for anyone who doesn't want to build from source, since we don't have Windows nightlies (due to their being blocked on expect and dbg, which Inspect would unblock)


Last updated: Jul 06 2025 at 12:14 UTC