The Zen of Rust #15264

Closed
llogiq opened this Issue Jun 30, 2014 · 7 comments

Comments

Projects
None yet
7 participants
@llogiq
Contributor

llogiq commented Jun 30, 2014

Apart from our trifecta fast, safe, concurrent there is no manifesto (like e.g Tim Peters'. Zen of Python) that outlines the ideals that guide implementation and should also guide rustaceans while they develop applications.

Following Cunningham's law, here is a short and probably wrong Zen of Rust:

No magic, just code
Explicit is better than implicit (Thanks to Tim Peters)
Avoid unsafe code. Failing that, encapsulate it
Things that need not change shouldn't
Work with the type system
This isn't finished (TODO: Remove when no longer applicable)
Have fun!

@huonw huonw added the A-docs label Jun 30, 2014

@steveklabnik

This comment has been minimized.

Show comment
Hide comment
@steveklabnik

steveklabnik Jun 30, 2014

Member

I find the whole "Zen of" thing to be a pretty terrible name, but we do have a style guide draft in the works that contains this information.

Member

steveklabnik commented Jun 30, 2014

I find the whole "Zen of" thing to be a pretty terrible name, but we do have a style guide draft in the works that contains this information.

@sinistersnare

This comment has been minimized.

Show comment
Hide comment
@sinistersnare

sinistersnare Jun 30, 2014

Contributor

I disagree with @steveklabnik's comment, The Zen of Python accurately portrays the meaning of the work, and the poem is quite well structured in my opinion.

"The Zen of Rust" however might need a different name, but I agree, it would be nice to have a short manifesto of sorts regarding how Rustaceans write their code. The style guide is exactly what it says it is, a guide, not a short and sweet poem about the core values of Rust.

Contributor

sinistersnare commented Jun 30, 2014

I disagree with @steveklabnik's comment, The Zen of Python accurately portrays the meaning of the work, and the poem is quite well structured in my opinion.

"The Zen of Rust" however might need a different name, but I agree, it would be nice to have a short manifesto of sorts regarding how Rustaceans write their code. The style guide is exactly what it says it is, a guide, not a short and sweet poem about the core values of Rust.

@nathantypanski

This comment has been minimized.

Show comment
Hide comment
@nathantypanski

nathantypanski Jun 30, 2014

Contributor

If a "core values" statement happens, then I think the things as listed ("no magic, just code", "avoid unsafe code. failing that, encapsulate it") aren't really fundamental enough to rank among them. Or maybe it's just writing style - I think if we had a nice list, it was really beautifully written, and actually struck at the heart of why Rust is so awesome, then the community would jump on it.

Either way, I'd sooner wait until after the style guide comes about to start focusing on something like this. Even if they target different goals, a style guide can help expose the idioms that make Rust so great to work with.

Contributor

nathantypanski commented Jun 30, 2014

If a "core values" statement happens, then I think the things as listed ("no magic, just code", "avoid unsafe code. failing that, encapsulate it") aren't really fundamental enough to rank among them. Or maybe it's just writing style - I think if we had a nice list, it was really beautifully written, and actually struck at the heart of why Rust is so awesome, then the community would jump on it.

Either way, I'd sooner wait until after the style guide comes about to start focusing on something like this. Even if they target different goals, a style guide can help expose the idioms that make Rust so great to work with.

@llogiq

This comment has been minimized.

Show comment
Hide comment
@llogiq

llogiq Jun 30, 2014

Contributor

@nathantypanski, this is not about a statement why Rust is so awesome. It should rather be a set of guidelines on what to pursue and what to avoid - both in implementing rust and implementing programs in rust. Also I'm open on a better name; I just shamelessly stole from Tim Peters' work which brought up the "Zen". I also don't believe it should necessarily be about style.

So what are the fundamental values?

Contributor

llogiq commented Jun 30, 2014

@nathantypanski, this is not about a statement why Rust is so awesome. It should rather be a set of guidelines on what to pursue and what to avoid - both in implementing rust and implementing programs in rust. Also I'm open on a better name; I just shamelessly stole from Tim Peters' work which brought up the "Zen". I also don't believe it should necessarily be about style.

So what are the fundamental values?

@aturon

This comment has been minimized.

Show comment
Hide comment
@aturon

aturon Jun 30, 2014

Member

I think that @brson and @nikomatsakis have done some work toward a document like "The Rust Way", but I'm not sure what the status of the document is. The idea was not so much to lay out detailed coding guidelines as to spell out the core driving principles that make Rust different/interesting.

I've been working on a separate document that does spell out coding guidelines for Rust. You can see a draft here. These guidelines will be moving into the rust-lang github organization in the next week or two. I would greatly appreciate any PRs!

Member

aturon commented Jun 30, 2014

I think that @brson and @nikomatsakis have done some work toward a document like "The Rust Way", but I'm not sure what the status of the document is. The idea was not so much to lay out detailed coding guidelines as to spell out the core driving principles that make Rust different/interesting.

I've been working on a separate document that does spell out coding guidelines for Rust. You can see a draft here. These guidelines will be moving into the rust-lang github organization in the next week or two. I would greatly appreciate any PRs!

@steveklabnik

This comment has been minimized.

Show comment
Hide comment
@steveklabnik

steveklabnik Jul 30, 2014

Member

I don't want to encourage the weird cultural appropriation of "Zen of," and we also have a zillion FAQ documents and such that explain why Rust is built the way it is. I'm closing this in favour of the FAQ(s), and the coding guidelines.

Member

steveklabnik commented Jul 30, 2014

I don't want to encourage the weird cultural appropriation of "Zen of," and we also have a zillion FAQ documents and such that explain why Rust is built the way it is. I'm closing this in favour of the FAQ(s), and the coding guidelines.

@liigo

This comment has been minimized.

Show comment
Hide comment
@liigo

liigo Jul 31, 2014

Contributor

+1
2014年7月31日 上午7:37于 "Steve Klabnik" notifications@github.com写道:

I don't want to encourage the weird cultural appropriation of "Zen of,"
and we also have a zillion FAQ documents and such that explain why Rust is
built the way it is. I'm closing this in favour of the FAQ(s), and the
coding guidelines.


Reply to this email directly or view it on GitHub
#15264 (comment).

Contributor

liigo commented Jul 31, 2014

+1
2014年7月31日 上午7:37于 "Steve Klabnik" notifications@github.com写道:

I don't want to encourage the weird cultural appropriation of "Zen of,"
and we also have a zillion FAQ documents and such that explain why Rust is
built the way it is. I'm closing this in favour of the FAQ(s), and the
coding guidelines.


Reply to this email directly or view it on GitHub
#15264 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment