Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Karate Bastard
Jul 31, 2007

Soiled Meat
I was blown away by the go tour. Succinct and to the point. Is there anything similar for rust?

Adbot
ADBOT LOVES YOU

Karate Bastard
Jul 31, 2007

Soiled Meat
Bingo! That hit the spot. Thanks!

Karate Bastard
Jul 31, 2007

Soiled Meat
I get the impression the Rust people aren't really great communicators. For example, take the Rust by example that was just linked here. It's nice and all, but I keep getting thrown off track every other paragraph because of how they use (or misuse?) common terms in programming that doesn't quite agree with how most everyone else use them. Or maybe it's just sloppy use of the English language in general, with ambiguous semantics and half-finished statements.

Example:
code:
    // Consume a list, and return the same list with a new element at its front
    fn prepend(self, elem: u32) -> List {
        // `Cons` also has type List
        Cons(elem, Box::new(self))
    }
"Consume"? Really? I see the code they put there, and for what that does, in my experience most people would just say "takes". Sure, I can maybe accept that "consume" could possibly maybe not quite mean what they use it for here, but for most people in programming (?) "consume" has mutable or destructive connotations, like sucking data from a stream for processing, making it inaccessible for other processors of data from the same stream; it is "consumed" like food and cannot be consumed like food again.

You could argue that this is not a major thing, but on the contrary I'd argue that this choice of words is a collossal red humpback being hauled back and forth across the welcome mat, and frankly it is negatively impacting my desire to cross it.

Again:
code:
    // but public structs with private fields can't be constructed
    // Error! `BlackBox` has private fields
    //let black_box = my::BlackBox { contents: "classified information" };
    // TODO ^ Try uncommenting this line

    // However, structs with private fields can still be created using
    // constructors
    let _black_box = my::BlackBox::new("classified information");
So public structs with private fields can't be constructed but can still be created using constructors. Really? (Yes, after rereading the code a few times I realize it really does what I assumed it would do, and structs work the way I assumed they would work, and those comments are just whale dragging).

More:

quote:

This formatting functionality is implemented via traits, and there is one trait for each argument type. The most common formatting trait is Debug, which handles cases where the argument type is left unspecified: {} for instance.
...
Here's the full list of formatting traits and their respective argument types:

unspecified -> Display
? -> Debug
o -> Octal
x -> LowerHex
X -> UpperHex
p -> Pointer
b -> Binary
e -> LowerExp
E -> UpperExp

Oh boy. So "argument types" is no longer the types of the arguments, I take it, as most of the "traits" refer to integer numbers in various bases which do not matter to the internal representation of an integer stored in memory. And why only one? Is the Rust formatting support like super-gimped compared to how most other languages do it, where you can commonly do things like -03.4d? And {} is when the argument type is left unspecified, which is handled by Debug, except it is handled by Display.

Ugh:

quote:

Implementing fmt::Display for a structure where the elements must each be handled sequentially is tricky. The problem is that each write! generates a fmt::Result. Proper handling of this requires dealing with all the results. Rust provides the try! macro for exactly this purpose.

Using try! on write! looks like this:
code:
// Try `write!` to see if it errors. If it errors, return
// the error. Otherwise continue.
try!(write!(f, "{}", value));

So what does try! do? What does it "return"? What does it "continue"? What does it do that its absence doesn't? Does it explicitly silence errors? If so, why is it called try!?

I'm sort of inquisitive when it comes to new languages and I've given Rust an eye-over a few times in the past, and this sort of thing where the documentation is more of a distraction than a help is not a new thing in Rust, but I must say that it turns me off. I cannot shake the feeling that this weird text is written by a weirdo whose weird ideas also have made it into the language.

What do you guys think? Do you have a similar impression of Rust docs, or is it just me being whiny and/or dumb? And perhaps more importantly, is Rust good? Is it worthwhile learning it (why?) or is it just a weirdo language for weirdos?

Karate Bastard
Jul 31, 2007

Soiled Meat
Well yeah, in a sense, but the data is still there, accessible unchanged just one hop away, containerized if you will. Even less "consumed" than a wrapped function. Or am I missing something fundamental?

Karate Bastard
Jul 31, 2007

Soiled Meat
Thanks for all the good points guys! I guess I'll find some toy problems to dick around with instead.

Karate Bastard
Jul 31, 2007

Soiled Meat
What is Rust is it some sort of Scientology? I dip into this thread every so often and I never seem to know half the terms you people fling about, and probably the other half don't mean what I think īt do. Is there some sort of indoctrination course you have to take?

Karate Bastard
Jul 31, 2007

Soiled Meat

taqueso posted:

Yes, it is Scientology, but you aren't invited. Sorry. Not sorry.

That doesn't sound much like Scientology at all!

But joking aside, is there such a thing nowadays similar to that go tutorial? That was super efficient in getting me into go, to understanding the key points that set it apart from other languages I knew from previous and how to think about it.

Rust didn't have that in the past (afaik?) so I'm still an ignoramus. Does it now?

Adbot
ADBOT LOVES YOU

Karate Bastard
Jul 31, 2007

Soiled Meat
Hey neat, thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply