value of documenting error messages?

Ruben Astudillo ruben.astud at gmail.com
Wed Jun 2 15:22:47 UTC 2021


I am no GHC developer, so this is not my place to reply. Even though I
humbly would like to put an argument in favor of numbers.

On 02-06-21 06:46, Tom Ellis wrote:
> On Tue, Jun 01, 2021 at 03:40:57PM -0700, Alec Theriault wrote:
>> Rust has taken an interesting approach for this: every error message is
>> given a unique number like "E0119"
> 
> Is there a particularly strong reason to use numbers as codes when we
> have the entire space human-readable strings available to us?  Even
> the subset of case-insensitive strings formed from alphanumeric
> characters plus underscore seems more suitable for the encoding than
> positive integers.
> 
> e.g. "conflicting_trait_implementations" seems better than "E0119"

One is SEO-optimization. A number like #0119 on a search string like "ghc
error #0119" ought to have as a first result the GHC user docs. This is a
great user experience for students. A more general search string can have
more results on other languages and is difficult to say we would be first
result.

Second one is that a number is shorter than a general string. That way we
can highlight it on a error message on the terminal without occupying to
much space. Current messages in GHC are already too big.

-- 
-- Rubén
-- pgp: 4EE9 28F7 932E F4AD


More information about the ghc-devs mailing list