Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EEP 74: Erlang Error Index #1

Closed
wants to merge 1 commit into from
Closed

Conversation

robertoaloi
Copy link
Owner

To start the discussion.

@robertoaloi robertoaloi force-pushed the erlang-error-index branch 3 times, most recently from b5ec4e1 to 19ba190 Compare August 26, 2024 11:51
eeps/eep-0072.md Outdated Show resolved Hide resolved
eeps/eep-0072.md Outdated Show resolved Hide resolved
eeps/eep-0072.md Outdated Show resolved Hide resolved
eeps/eep-0072.md Outdated
-define(DEFAULT, #{a => 1}).

updated(Value) ->
?DEFAULT#{a => Value}.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a meant to be timeout?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, fixed.

eeps/eep-0072.md Outdated Show resolved Hide resolved
eeps/eep-0072.md Outdated
Error cannot be re-used. If a tool stops emitting an error code, the
_deprecated_ error code is still documented in the index, together
with a deprecation notice. This is to avoid re-using a single code for
multiple purposes.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe propose a mechanism to submit new namespaces/codes?

eeps/eep-0072.md Outdated

* The `erlc` compiler and the `dialyzer` type-checker would start
emitting error codes together with errors and warnings messags.
* The tools could also expose a `--explain` option from the command

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would erlc fetch the full explanation? How does rustc do it?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@garazdawi I had to check. Apparently the Markdown files are actually stored in a crate which is part of the compiler itself:

https://github.com/rust-lang/rust/blob/master/compiler/rustc_error_codes/src/error_codes/

Then they have a registry (a hashmap) which maps each error code to its corresponding description.

When you pass the explain command they simply try to fetch the description. Not very advanced.

The initial plumbing was introduced here.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we should remove this as it creates a dependency between what is stored online and what is embedded in the compiler. It is better if everyone just uses the webpage directly.

eeps/eep-0072.md Outdated Show resolved Hide resolved
Copy link

@garazdawi garazdawi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked at how haskell is doing things and I like it. Simple and effective.

What I think we should do is add https://errors.erlang.org as a github page. That github page will contain errors for the tools part of Erlang/OTP, but it will also contain links to other namespaces so that users can find the errors for elvis, elp, elixir, gradualizer etc etc from that page. I don't think we should make the external errors part of that page as that would mean that the amount of administration needed will increase. Possibly we can make the search index incorporate all namespaces.

I then propose that it will be a joint effort from us and WhatsApp to manage this page, that is we will all have merge/commit rights in that repo.

Maybe we should also create a convention on how errors/warnings are printed so that tools know how to parse them?

eeps/eep-0072.md Outdated Show resolved Hide resolved
eeps/eep-0072.md Outdated

* The `erlc` compiler and the `dialyzer` type-checker would start
emitting error codes together with errors and warnings messags.
* The tools could also expose a `--explain` option from the command

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we should remove this as it creates a dependency between what is stored online and what is embedded in the compiler. It is better if everyone just uses the webpage directly.

@robertoaloi robertoaloi force-pushed the erlang-error-index branch 3 times, most recently from 86a2335 to 217ce71 Compare November 11, 2024 23:48
@robertoaloi robertoaloi changed the title EEP 72: Erlang Error Index EEP 74: Erlang Error Index Nov 11, 2024
@robertoaloi
Copy link
Owner Author

Superseded by erlang#70

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants