5 ms·
I love the new error messages. Rust seems to have started that trend, Python also added better errors recently.
by exciteabletom 5y ago
I love the new error messages. Rust seems to have started that trend, Python also added better errors recently.
- Skinney 5y agoRust was inspired by Elm, if I’m not much mistaken.
- deleted 5y ago[deleted]
- 411111111111111 5y agoI love it how good ideas just spread everywhere in open source. Everyone's life improves and usually people aren't obnoxious about it, which tends to happen in more politically charged topics (i.e. when there is a company pushing a narrative such as google,apple or microsoft)
- wiremine 5y agoRust was started in 2010, and Elm in 2012. https://en.wikipedia.org/wiki/Rust_(programming_language) https://en.wikipedia.org/wiki/Rust_(programming_language) https://en.wikipedia.org/wiki/Elm_(programming_language) https://en.wikipedia.org/wiki/Elm_(programming_language) That said, the concepts in question are all much older. If you're ever bored, check out the "Influenced by" sections of the Wikipedia pages on programming languages. It's amazing how old so many of the "new" ideas really are.
- masklinn 5y ago> Rust was started in 2010, and Elm in 2012. That doesn’t preclude learning from younger langages in any way. The trend of providing really helpful and valuable error messages (especially compilation) really started with Evan’s “compilers as assistants” and “compiler errors for humans” from 2015, although there had been forays into improvements to e.g. error localisation from clang. And Rust’s improvements absolutely come from there, as acknowledged by Jonathan Turner’s 2016 “shape of errors to come”: https://blog.rust-lang.org/2016/08/10/Shape-of-errors-to-come.html https://blog.rust-lang.org/2016/08/10/Shape-of-errors-to-com... as well as his “new error format” proposal / rfc which eventually lead to the change: https://github.com/jonathandturner/rust_proposals/blob/master/rust_new_error_format.md https://github.com/jonathandturner/rust_proposals/blob/maste...
- mulander 5y agoI remember Ada always having very precise and helpful error messages like this one: literal_string.adb:5:33: warning: wrong length for array of subtype of "Standard.String" defined at line 5 literal_string.adb:5:33: warning: "Constraint_Error" will be raised at run time then when you run the app it behaves as advertised $ ./test raised CONSTRAINT_ERROR : literal_string.adb:5 length check failed There are many others and when I saw llvm improving error messages for C and C++ (which I saw happening before Rust was a thing) I always thought it was inspired by Ada and it's helpful messages like: expected private type "<type name>" defined at ...; found type "<type name>" defined at ... "<name>" is undefined (more references follow); possible misspelling of "<name>" and the many others that were just there when I first tried Ada around 2008/2009.
- bmitc 5y agoAccording to this: https://en.wikipedia.org/wiki/Graydon_Hoare https://en.wikipedia.org/wiki/Graydon_Hoare Rust was started in 2006.
- blacktriangle 5y agoPeople around here give Elm way too much credit for inventing things it didn't invent or wasn't even the first to ship useable versions of, but I think its fair to give Elm full credit for elevating the quality of error messages one can expect from a language or framework.
- agumonkey 5y agoclang also played that game around that time (these are the two I had in mind when thinking of this)
- masklinn 5y agoTrue, Evan actually mentions Clang (noting that he’d met people who’d switched from gcc to clang due to the error messages) in “compiler errors for humans”.
- deleted 5y ago[deleted]
- bla3 5y agoexpressive diagnostics was one of clang's early selling points: https://clang.llvm.org/diagnostics.html https://clang.llvm.org/diagnostics.html Clang was released 2007 and was usable 2009/2010-ish. Rust dev started 2010. I'm not saying the trend of having good diagnostics was started by clang, but it's a more believable than the claim that it was started by Rust. -- Rust-the-language is nice, but the Rust community feeling the need to mention Rust on every unrelated thread is a bit of a turn-off for me.
- linkdd 5y agoTemplate errors with g++ vs clang++ are what made me abandon the gcc toolchain for my dev environment (I still build against both compilers in my CI/CD though). Rust wasn't even a thing (not as hype and mature) at that time. Rust is nice, but the hype train is toxic (and that's true for every language/technology).
- thrwaeasddsaf 5y agoGCC also copied clang's excessive diagnostics and I'm seriously thinking of making a fork just to strip them out. I doubt the developers would accept a patch that implements --stfu.
- bla3 5y agoDoes -fdiagnostics-plain-output not do what you want?
- thrwaeasddsaf 5y ago$ cc -fdiagnostics-plain-output c.c cc: error: unrecognized command-line option ‘-fdiagnostics-plain-output’
- bla3 5y agoIt's new in gcc 11.1
- nindalf 5y ago
- lelanthran 5y ago> Rust seems to have started that trend, No it didn't. Lets not try to rewrite history here, clang started the trend of meaningful error messages, gcc quickly caught up.
- steveklabnik 5y agoOkay, lots of people arguing about this, so I'm gonna reply to you, the top-most person in this sub-thread :) I think the reason that it's easy to argue is that you can be talking about similar but slightly different things. When Rust was created doesn't really matter, exactly. For a very long time, errors looked something like this: hello.rs:2:4: 2:16 error: unresolved name: print_with_unicorns hello.rs:2 print_with_unicorns("hello?"); ^~~~~~~~~~~~~~~~~~~ At some point, "improving the error messages" became a project goal, and Jonathan Turner decided to take this on. This is described in https://blog.rust-lang.org/2016/08/10/Shape-of-errors-to-come.html https://blog.rust-lang.org/2016/08/10/Shape-of-errors-to-com... . The post explicitly cites Elm as inspiration because Rust was directly inspired by Elm in this regard. Yes, other languages may have started this trend earlier. Yes, maybe they influenced Elm, which influenced Rust. Yes, Rust may be "older" than Elm. But if you ask the people who began this effort, they will name Elm as the inspiration. (And yeah, then you can try to argue about who has influenced the broader public, which is effectively impossible to prove, IMHO.) Today that error looks like error[E0425]: cannot find function `print_with_unicorns` in this scope --> src/main.rs:2:5 | 2 | print_with_unicorns("hello?"); | ^^^^^^^^^^^^^^^^^^^ not found in this scope incidentally, and there's also JSON output, and if you're not on a terminal, you get the line numbers like before... lots of things are improved. This particular error doesn't show off some of the nicer things. Esteban Küber has taken up where Jonathan left off, and has been doing amazing work.