1
1
## Introduction
2
2
3
3
This proposal seeks technical coordination from the Haskell Foundation
4
- for improving the interop story around Haskell tooling error messages.
4
+ for improving the interop story between GHC and HLS. Once that is
5
+ done well, we might imagine taking our gained knowledge to improve
6
+ other interop around error messages.
5
7
While much of the work may be doable by volunteers, the HF would play
6
8
a role in harnessing and corralling the volunteers, as well as coordinating
7
9
common APIs between tools that are both easy to implement and easy to use.
@@ -13,8 +15,8 @@ among all tooling central to Haskell.
13
15
Currently, there is no discipline around error messages. This lack of
14
16
structure manifests itself in a number of ways:
15
17
16
- - Some tools parse the error messages that other tools
17
- produce . This is fragile, wasteful, and hard to keep up-to-date. For
18
+ - HLS must parse the error messages that GHC
19
+ produces . This is fragile, wasteful, and hard to keep up-to-date. For
18
20
example, the HLS looks to see if a GHC extension name appears in an error
19
21
message, in order to allow the user to automatically enable it via a pragma.
20
22
But since ` KindSignatures ` is a substring of ` StandaloneKindSignatures ` , any
@@ -23,7 +25,7 @@ structure manifests itself in a number of ways:
23
25
would actually work. While there is a workaround here, we can see that
24
26
better communication between GHC and HLS would avoid this class of problem.
25
27
26
- - Many Haskell error messages refer to advanced concepts. This is unavoidable,
28
+ - Many GHC error messages refer to advanced concepts. This is unavoidable,
27
29
as Haskell has advanced features. However, telling a user that their rigid
28
30
type variable does not unify with a type because there is a kind mismatch
29
31
is utterly bewildering to Haskell learners. Applying structure to error messages
@@ -43,16 +45,13 @@ not just as (fancy) strings. [This wiki page](https://gitlab.haskell.org/ghc/ghc
43
45
and [ this blog post] ( https://well-typed.com/blog/2021/08/the-new-ghc-diagnostic-infrastructure/ ) describe
44
46
roughly the state of play. However, this work currently lacks a very important
45
47
ingredient: clients. That is, if GHC is exporting new, fancy datatypes encoding
46
- its error messages, are these datatypes of use to, say, HLS? We've reached out
48
+ its error messages, are these datatypes of use to HLS? We've reached out
47
49
to potential clients for feedback, but the best response we've gotten is something
48
- along the lines of "sure, looks good". That's encouraging, but I would want to
50
+ along the lines of "sure, looks good". That's encouraging, but I would want to have
49
51
a little more coordination to make sure that the interface GHC is building is one
50
52
that can be easily consumed. The HF could help here by coordinating this
51
53
communication between projects.
52
54
53
- Furthermore, if this is successful in increasing interop between (say) GHC
54
- and HLS, then we can expand the idea to other tooling, as well.
55
-
56
55
The website describing error messages and error-generator identification
57
56
are both fresh in this proposal.
58
57
@@ -131,7 +130,8 @@ structured format.
131
130
132
131
1 . As capacity is available, the Coordinator would also organize (or encourage a volunteer
133
132
to organize) a website where error messages could be explained. This might be a wiki,
134
- or a git repository, or something exportable to e.g. readthedocs.io. Figuring out a good
133
+ or a git repository, or something exportable to e.g. readthedocs.io. This might even be
134
+ incorporated into the user manual. Figuring out a good
135
135
format would be the responsibility of the Coordinator, possibly by contacting stakeholders
136
136
with a survey or looking at other language communities.
137
137
0 commit comments