Elm already was the gold standard when it comes to helpful error messages and it's amazing to see that they're still working to make it even better. I hope other languages follow suit.
> Elm already was the gold standard when it comes to helpful error messages
I read this all the time about Elm, but did you actually try Elm for a real world project?
I did, and Elm error messages were one of the most painful point of the compiler: they're beautiful but very often completely unrelated to what's actually going wrong. They actually drove me away from the actual errors more than once.
Good error messages can make all the difference. I haven't worked with Elm, but Rust and Vulkan (through validation layers) also have specific, informative errors and warnings like this.
Both those technologies have well-earned reputations for having not-so-shallow learning curves, but that's almost not an issue when the tools always make it clear what has gone wrong.
We (Rust) took a lot of inspiration from Elm here.
One similarity to this post that sticks out:
> Maybe you just try the JavaScript way to see if it works:
Given that the final syntax for async/await was a bit controversial (postfix .await), the compile folks implemented parsing for (at least) the JavaScript way of doing it, and so you get a good error message telling you the correct way:
error: incorrect use of `await`
--> src/lib.rs:2:5
|
2 | await bar()
| ^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
This kind of thing can really help polyglots, as well as people new to the language.
I have not personally had the usecase for Rust just yet, but it is the only language I have never heard a negative thing about. That's huge, with how opinionated developers are.
The arguments for the language and general consensus are so strongly positive that without having used it myself I frequently recommend it (I passively follow the language's progress online).
A huge part of it is the developer ergonomics, a large amount of which comes from your compiler error messages.
When I talk to people about the gold standards, Rust and Elm are the examples I give.
Try to write a small program (a basic interpreter or something like that) and i bet you will have some gripes with Rust... I found that it was an extremely slow language to ramp up on.
Same. I have mixed feelings about it. The tooling is great, but I'm not totally convinced the borrow checker is the be-all, end-all of memory management it's sometimes made out to be. Also some of the decisions around syntax are questionable to me, like lack of top-level-inference just feels like a step backward compared to languages which have it. Also while the trait system and macros are really powerful, a lot of times how they are used by libraries seems quite magical, and it takes a lot of digging through documentation and sometimes source to really understand how things work.
Still in spite of that, I think it's an awesome project with a lot of enthusiasm behind it, and I'm happy to see languages exploring new ideas getting so much attention.
The lack of top level inference is a key part in getting great compiler errors: top level inference can be convenient, but it also leads to spooky action at a distance errors.
It really stands out with Elm and Rust and is much appreciated.
A human/e interface to compiler errors is critical to me. It means the difference between the compiler being an ally and the compiler being an enemy (or maybe a teacher who thinks you're just a bad student and is going to give you a bad grade no matter what, not that there's any scar tissue there).
Matters the world to me personally in terms of my enjoyment and flow and represents the kind of computing I want to do.
I read this all the time about Elm, but did you actually try Elm for a real world project?
I did, and Elm error messages were one of the most painful point of the compiler: they're beautiful but very often completely unrelated to what's actually going wrong. They actually drove me away from the actual errors more than once.