Stream: ideas

Topic: Codifying error messages


view this post on Zulip Hristo (Mar 10 2024 at 14:10):

I'm typing from my mobile and it's not straightforward to find whether or not this has been brought up before.

I think many people really like Rust's --explain functionality and I was wondering if any similar Roc efforts have been discussed (for introduction not necessarily at the present stage). It could be a huge win, in terms of user experience.

view this post on Zulip Richard Feldman (Mar 10 2024 at 14:27):

personally I'm not a fan of compilers emitting error codes, but I do like having them link to URLs with helpful information related to the error

view this post on Zulip Richard Feldman (Mar 10 2024 at 14:27):

however, at the moment we don't have much in the way of actual articles to link to! :big_smile:

view this post on Zulip Miilyn (Mar 10 2024 at 14:34):

Obviously this example is way inferior of what Roc's "helpfulness" is aiming for -- but speaking of providing not error codes but URLs to related docs:

Example Next.js

view this post on Zulip Hristo (Mar 10 2024 at 14:35):

Yeah, I have to agree about user-facing error codes. They aren't user-friendly, not pretty. But the corresponding articles would have to be indexed by something.

@Richard Feldman, has my understanding been correct that you wouldn't be against this kind of a feature in the future?

view this post on Zulip Richard Feldman (Mar 10 2024 at 14:38):

I definitely like the idea of some error messages including URLs linking to helpful related articles!

view this post on Zulip Richard Feldman (Mar 10 2024 at 14:38):

I don't think they need identifiers beyond the URLs themselves

view this post on Zulip Richard Feldman (Mar 10 2024 at 14:39):

if we want to have a list of them somewhere, we can do that

view this post on Zulip Miilyn (Mar 10 2024 at 14:47):

Hristo said:

I'm typing from my mobile and it's not straightforward to find whether or not this has been brought up before.

I think many people really like Rust's --explain functionality and I was wondering if any similar Roc efforts have been discussed (for introduction not necessarily at the present stage). It could be a huge win, in terms of user experience.

Not trying to bash your proposal, but another downside of --explain is that it integrates rather poorly with editor tooling (i.e. tends to require a deliberate, manual step).

Granted, it's nice to have the option to get further explanation / docs but in that case URLs seem to cause the least "friction".

view this post on Zulip Hristo (Mar 10 2024 at 15:14):

@Miilyn, no worries - I do understand what you mean.

I have to clarify that the proposal is more in the direction of introducing a means for accessing more detailed content, which is associated with and expands upon the (what are usually) 2-3 sentences' worth of compiler explanation. How those are made available to the user doesn't have to be limited to --explain or any other mechanism per se.

view this post on Zulip Kiryl Dziamura (Mar 10 2024 at 20:39):

One advantage of coded errors is that it’s easier to find some discussions (articles, stack overflow, github etc) related to this specific error

view this post on Zulip Anton (Mar 11 2024 at 08:52):

I set up an issue #3580 a while ago for something like this :)


Last updated: Jun 16 2026 at 16:19 UTC