Live data from Hacker News

Rust's language ergonomics initiative

blog.rust-lang.org

71–80 of 295 posts

Re: Rust's language ergonomics initiative

#71
development "ergonomics is something close to my heart.

I'm a statically-typed, "easy-on-the-eyes" Python looking-loving guy, but there's something beyond that, when it comes to "ergonomics".

I'm really impressed with the Clojure community and parinfer, paredit(old lisp school) and just slinging code around with rapid feedback.

Re: Rust's language ergonomics initiative

#72
post #57

Earlier quoted context omitted.

Opt-in tracking, I really hope you mean. I know the concerns with getting unrepresentative samples but sending what I'm working on to a third party is something that would immediately stop me using an entire language for any form of my work.

gah! Yes, I mean "we would never consider tracking you without your express given consent." That's opt in not opt out.

:) Thought that was the case, seemed odd that people were saying it like it was such a small deal!

Re: Rust's language ergonomics initiative

#73
post #70

Earlier quoted context omitted.

We have discussed doing this in the past, actually. Opt-in (oops, had "out" here initially) is very important here! I am not sure if it's something that ever landed or not...

Is there a mailing list I can subscribe to that will tell me when I can turn this on? I'm hoping not to have to listen to rust-dev for the trigger phrase.

I don't know off the top of my head because it's been a while since we talked about it and I haven't paid super close attention to rustup's development. I am assuming that we would make an announcement on the blog because we'd want to be very clear about what's going on, and of course, try to convince people to opt in :)

Re: Rust's language ergonomics initiative

#74
post #7

A challenge I've had with Rust lately is factoring initialization code into separate functions. Because of stack-based allocation it has to stay in the main function. For example: pub fn do_many(iter: &mut Iterator ) { let mut job_id = None; let job_id_env = env::var("MYAPP_JOB_ID"); let mut log = if let Ok(val) = job_id_env { write_pid_file(&val); job_id = Some(val.clone()); let home = env::var("HOME").expect("HOME…

> Alternately, I wish rust would let me say that all those temporary values should live as long as the returned thing (log and db), so it can keep them around even if I don't have variables for them. Possibly I've missed something critical about your example, but I think you may want to create a struct Log, turn open_log() into Log::new(), and put the things the log needs (such as the log file) inside Log, owned by L…

So I passed out a lot of upvotes, but I thought I would add a thank you to you and others trying to help me. :-)

I will try your suggestion re the log. The database example is trickier I think since the prepared statements have references to `conn`, so it can't move. Also it's annoying that I have to make `negotiator` even when I don't need it.

Re: Rust's language ergonomics initiative

#75

Earlier quoted context omitted.

Informal is fine. The important thing is to do user testing in an ongoing way, not just once. Without a feedback loop it's quite surprising how quickly development priorities diverge from what's really important.

We are always constantly trying to listen to people and get feedback; for example, it's one of the reasons I pay such close attention to these threads! There's always room for improvement, but iterating in this way is defintely a core value.

[deleted]

Re: Rust's language ergonomics initiative

#76
post #57

Earlier quoted context omitted.

We have discussed doing this in the past, actually. Opt-in (oops, had "out" here initially) is very important here! I am not sure if it's something that ever landed or not...

Opt-in tracking, I really hope you mean. I know the concerns with getting unrepresentative samples but sending what I'm working on to a third party is something that would immediately stop me using an entire language for any form of my work.

It doesn't have to be strictly opt-in or opt-out. There could be two versions released, a version without tracking could live on the same release page, just a bit lower and not in a bold font or something like that, pushing new users towards the version with opt-out tracking.

Re: Rust's language ergonomics initiative

#77
post #66

Earlier quoted context omitted.

The Linux authors don't write the C standard.

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.

Re: Rust's language ergonomics initiative

#79

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,…

On this note, I'm actively seeking JavaScript developers interested in doing some user studies of a compile-to-js language I'm working on.

It emphasizes ergonomics, actually, as well as making functional best-practices (typed immutability, etc) more accessible.

I'm in San Francisco but happy to conduct remotely. I'm targeting people familiar with ES6 and functional styles, but interested in folks of all experience levels.

If anyone would be interested in trying it out, shoot me an email at rattray.alex – gmail.

Re: Rust's language ergonomics initiative

#80

From moving from Perl to Rust, the only thing that I miss is the postfix "if": return true if number > 2; VS: if number > 2 { return true } I find that one-liners like these are really ergonomic.

ProTip:

In both languages you can do the following:

    return number > 2;
Post reply on HN