Fork me on GitHub
#error-message-catalog
<
2016-05-02
>
shaunlebron03:05:54

hey guys, just catchin up here

shaunlebron03:05:55

does anyone else fear the combinatorial explosion of “__ cannot be cast to __” errors?

shaunlebron03:05:42

might that class of errors be covered by the potential 1.9 release? (presuming it will check macro arg types)

cfleming03:05:25

@shaunlebron: Yeah, hopefully 1.9 will improve things a lot there.

cfleming03:05:44

It’s not clear what will actually be included though.

shaunlebron03:05:45

@cfleming: I was looking for a source on what exactly alex was working on in relation to errors, I couldn’t find anything

cfleming03:05:06

@shaunlebron: There’s basically no information. I’ve heard some rumours but nothing concrete. There’s a design page here which is more or less what I talked about in my conj talk: http://dev.clojure.org/display/design/Macro+Grammars

cfleming03:05:20

error-test there is the test repo I demoed which I sent to Alex.

cfleming03:05:16

To error-test?

cfleming03:05:15

It’s not open, I was planning to tidy it up but have never had the time, and now there seems little point since it may or may not coincide with whatever they come up with.

cfleming03:05:38

Actually, I’ll just open it up, one sec.

cfleming03:05:47

I’m just going to update the README

shaunlebron03:05:15

for reference here, this is colin’s talk about improving error messages with grammars: https://www.youtube.com/watch?v=kt4haSH2xcs

shaunlebron03:05:24

I’m not sure yet what the intersection between your macro grammars, elena’s error message work, alex’s 1.9 work, and this error cataloging effort

shaunlebron03:05:39

would be nice if someone had context in all those places

shaunlebron03:05:31

I just have a feeling that the problem trying to be solved by logging the myriad of causes for different exceptions may be solved by just working on an alternate clojure compiler with reader conditionals to perform runtime :pre and :post checks for functions and this other macro grammar stuff

cfleming03:05:53

Ok, readme updated.

cfleming03:05:18

I think to a certain extent they’re orthogonal.

cfleming03:05:42

The macro grammars solve a specific problem, but it’s a pervasive problem with horrible error messages.

cfleming03:05:23

Alex’s 1.9 work will probably be basically exactly that, with some other related things I’ve heard rumours about but don’t have any good information on.

cfleming03:05:10

This error cataloging effort, once the macro grammar stuff is in place, will be useful for figuring out which errors are problematic for people in practice, and will hopefully be a substitute for newbies for the intuition about what probably happened that experienced devs build up over time.

cfleming03:05:34

And also a place to discuss ways to improve those messages and perhaps catch those cases, either in tooling or Clojure itself.

cfleming03:05:44

Elena’s work is probably based on something like this catalog, and takes the errors identified in it and tries to improve their messages. In something like Cursive I could (and will) use that directly but can probably also add more functionality on top, i.e. perhaps identifying where exactly the error probably happened.

cfleming03:05:04

Note that macro grammars are good for more than just error handling, they hopefully also make writing macros much easier.

eggsyntax13:05:25

@shaunlebron: I was going to point you to issue 7 (prior art) but then I saw that you were the one who filed it 😉. That possible combinatorial explosion does suggest that we may want to consider some sort of regex-based solution the way that prior art did. The one thing that would argue against it is that sometimes there are common causes for particular flavors of that exception (eg I committed a page for "boolean cannot be cast to symbol," because new clojurians often hit that by forgetting the inner brackets around a require). But of course we could look for specific cases like that first & then fall back to the general " cannot be cast to ".