News for hackers. Stuff that matters.
Re:I stopped everything and started writing C again by necubi on Wednesday March 12, 2025 @03:41PM (#43346920)
I don't follow your first point—the compiler is pointing out exactly what the problem is (the argument has the incorrect type) and then telling you what you likely wanted to do (borrow the String). What would you see as a more helpful error message in this case?
Re:I stopped everything and started writing C again by crabbone on Wednesday March 12, 2025 @05:07PM (#43347688)
The compiler says "expected X, but found Y". I don't know how to interpret this: is the type of the thing underlined with "^^^" X or Y? "Expected" and "found" are just like "up" and "down" in space: they are meaningless if you don't know what the compiler expects (and why should it?).

What it needs to say is something along the lines of "a function f is defined with type X, but is given an argument of type Y": maybe the function should be defined differently, maybe the argument needs to change -- it's up to the programmer to decide.

Re:I stopped everything and started writing C again by kelnos on Wednesday March 12, 2025 @07:05PM (#43348661)
I dunno, I feel like if you've used a compiler regularly, "expected X, but found Y" is a pretty common idiom/shorthand that people understand. Your wordier version of that feels unnecessary to me.
Re:I stopped everything and started writing C again by tartoran on Wednesday March 12, 2025 @07:14PM (#43348722)
C is a low level language and deals with things close to the metal. It's probably not fun to write a large business app in barebones C but you having control over low level things makes other things possible and very fast too. Depending on the type of problem you have use the appropriate and favorite language.
Re:I stopped everything and started writing C again by nuancebydefault on Wednesday March 12, 2025 @05:55PM (#43348045)
I don't see any way that the use if expected and found can be ambiguous for a type conflict.

I buy a fruit mixer from Amazon.com ; I send it back along with a note: expected a 230VAC mixer, found a 110VAC mixer.

Re:I stopped everything and started writing C again by jacksnipe on Wednesday March 12, 2025 @05:17PM (#43347768)
Since it's underlining code you wrote, it must be "found" that is highlighted, not "expected". Much like up and down, gravity exists to ground all of us in the same direction.
Re:I stopped everything and started writing C again by shakna on Wednesday March 12, 2025 @05:42PM (#43347954)
I'm over here with TTS: Underlining in a terminal rarely translates to audio. It isn't the only consideration that needs to be made, when making things clear.
Re:I stopped everything and started writing C again by knowitnone on Wednesday March 12, 2025 @08:44PM (#43349293)
except nobody has to cater to every worst case scenario
Re:I stopped everything and started writing C again by shakna on Wednesday March 12, 2025 @10:46PM (#43349928)
So every disabled programmer is now a "worst case scenario"?
Re:I stopped everything and started writing C again by SunlitCat on Thursday March 13, 2025 @03:15PM (#43356389)
Or in short, Rust isn't for disabled programmers?
Re:I stopped everything and started writing C again by BlarfMcFlarf on Thursday March 13, 2025 @10:42AM (#43353881)
I am sure the Rust community would welcome feedback from blind developers about their error messages. Accessibility is a good thing.
Re:I stopped everything and started writing C again by steveklabnik on Thursday March 13, 2025 @12:36PM (#43354950)
One thing that could help here is that the compiler is able to offer output in JSON, allowing you to format the messages however you'd like: https://doc.rust-lang.org/rustc/json.html

I'm not aware of an existing tool to produce blind-friendly output, but this would at least be a part of that!

Re:I stopped everything and started writing C again by jacksnipe on Friday March 14, 2025 @09:54AM (#43362678)
I hadn’t considered this use case, thank you for pointing it out!
Re:I stopped everything and started writing C again by crowdstriker on Thursday March 13, 2025 @11:25AM (#43354286)
You cannot be serious right now.