Live data from Hacker News

Rust's language ergonomics initiative

blog.rust-lang.org

201–210 of 295 posts

Re: Rust's language ergonomics initiative

#201
post #198
post #194

Earlier quoted context omitted.

You can leave the inner type out... https://play.golang.org/p/m3bLmneArB

Ah, maybe it's when they're alias types that that wouldn't work?

Actually I just tried that and it worked also. But I think you're right that this hasn't always been the case because I remember being annoyed about it. Or maybe we're both crazy.

You definitely need to specify the type for an interface, but that makes sense.

Re: Rust's language ergonomics initiative

#202
post #41

Are there plans to do user studies? 10 minutes watching new users code in Rust will give you better ideas than 10 weeks thinking about the problem in your head. I feel like there's a real lack of user testing in software development tools land. If you're developing software for unsophisticated users it's obvious that you should be doing user testing, but it's an often ignored fact that developers are users too! APIs,…

"If you're developing software for unsophisticated users it's obvious that you should be doing user testing" Compilers actually have a unique opportunity to introduce some form of opt-out tracking of all of the compilation errors with sources, etc. This could really help to understand the users.

With good auto completion, the user should never even have to press the compile button or hit a compiler error. (Slight exaggeration)

This means the user might have struggled a long time with the code before even hitting the compile button. If you only collect statistics from compilation you will miss all this pre-struggle.

Re: Rust's language ergonomics initiative

#203

"Idea: implied bounds" sounds like a very interesting idea. It is a pain copying the bounds as author mentions. I also have worked with library code that does not consistently use trait bounds and it can lead to very confusing errors. The thing that keeps getting me now is there are so many types moving around with generics and traits. It would be nice if it were easier for something to be object safe and/or Any was…

With implied bounds my gut reaction is that you get c++ templates without "concepts". Ie the situation c++ is in today, where it's perfectly fine to instantiate a template with an implicit bound but you only get a super confusing error message later when you try to use a particular function that this bound requires.

Re: Rust's language ergonomics initiative

#204

I still can't get my head around rust. While all those features definitely make sense, I find it very confusing sometimes. Is there something like rust for c++ programmers?

Curious, is it harder for c++ programmers to learn Rust than dev from higher level devs? Because ive seen Rust has a lot more success recruiting devs from python, js, even php.

Not really, it is mostly a culture thing.

There are two main communities in C++, those that embrace safety and take advantage of the language features to improve their productivity, while going down to lower level constructs if performance needs an extra push.

Then there are those that are kind of exiled C developers using a C++ compiler, forced to migrate to C++ on their work, trying to use it as C with C++ compiler.

This is the group that has more issues with Rust.

Re: Rust's language ergonomics initiative

#205
post #66

Earlier quoted context omitted.

I suppose the question then is, did writing Unix make C ergonomic? :)

Good question :) I think it did, though I'd be interested to hear an informed opinion.

From Dennis himself,

https://www.bell-labs.com/usr/dmr/www/chist.html

The best part for those that care about security:

"To encourage people to pay more attention to the official language rules, to detect legal but suspicious constructions, and to help find interface mismatches undetectable with simple mechanisms for separate compilation, Steve Johnson adapted his pcc compiler to produce lint [Johnson 79b], which scanned a set of files and remarked on dubious constructions."

So although C designers saw the dangers of C and provided static analysis from the early days, many C developers keep ignoring them.

Re: Rust's language ergonomics initiative

#206

Earlier quoted context omitted.

Good question :) I think it did, though I'd be interested to hear an informed opinion.

I, for one, see C as both unsafe and unergonomic. The many features of C++ can be seen as various attempts to make some or another thing expressible in C -- parameterized datatypes, namespacing, encapsulated resource management -- that wasn't before.

It is, after being forced to use BCPL to finish his PhD and being used to languages like Simula, Bjarne swore he wouldn't be doing that again.

Hence why he started to design C with Classes after getting his job at AT&T.

https://www.youtube.com/watch?v=ZO0PXYMVGSU

Around 29:00.

Re: Rust's language ergonomics initiative

#207
Can't trust such ideas. Especially when I read about "conventions are good". No, "conventions" is the plague and that example of mod.rs is an example of crappy thing in Rust, difficult to gasp by a newbie. Exactly because it's just "convention". Hope they will not destroy Rust by adding more "conventions" or by switching to " implicity over explicity" camp of noobs.

Re: Rust's language ergonomics initiative

#208
post #125

After writing Rust in production for a while, the biggest bugbear I have is the naming/file structure. I end up a lot with this; src/main.rs src/combobulator/mod.rs src/combobulator/tests.rs src/tests.rs src/somethingelse/tests.rs src/somethingelse/mod.rs Because I find tests in the same file a bit confusing. It's really easy with maven-style layouts to know that "only things in main/java or main/scala get compiled a…

[deleted]

Re: Rust's language ergonomics initiative

#209
post #86

I'm really encouraged by this post. I ran into a situation somewhat related to the borrowing in match patterns this week [1], and whilst it's only a mild annoyance, it's lovely that it might get smoothened out. Today, i started using modules in anger, and was immediately mildly annoyed by the need to explicitly reference crates in my code, when they're already in my Cargo.toml, and to declare modules, when they're im…

please fork the language and call it somehow RustyRuby if you prefer things to be implicit.

Re: Rust's language ergonomics initiative

#210

Earlier quoted context omitted.

I also had problems understanding this whole crate system when I was playing with Rust.

This is extremely common, and is one of the reasons why it's such a big part of this post.

but in the post reason of the pain (conventions) described as a cure, and it's really awful.
Post reply on HN