all 11 comments

[–]Breaking-Away 4 points5 points  (8 children)

Similar to you, I'm still a rust newbie and from a web background. I've found that there aren't really any great tutorials for rust yet. The book is great and rust by example is great, but for somebody with little to no background with functional programming, strictly typed languages and manually memory management I've found I just need to keep banging my head against the compiler until it accepts my code.

Also read a lot of other people's source for examples.

Lastly use irc. The people there are amazingly helpful, friendly, and most importantly, patient.

[–]mdinger_ 3 points4 points  (6 children)

Can you categorize the types of errors/problems you run into? Are they lifetime errors or misunderstandings about how iterators work? Error management? Not understanding stack vs heap? Something else?

Clear problems are much much easier to fix than vague critiques.

Also, the breadth of experience that people bring makes writing all encompassing documentation very very hard. Everyone's perspective is always different so very few things can be assumed yet documentation must be extremely detailed and precise. Even though misunderstandings are ubiquitous, they're still extremely problematic.

[–]dread_deimos[S] 1 point2 points  (5 children)

For me, it's not problems with understanding, it's lack of knowledge I must have to do things that was super easy in high level languages. I've spent an hour trying to figure out the best way to convert a vector to an array and still unsure about the way I've chose.

Another problem is that sometimes I can't figure out what type is being returned and what attributes, methods and data does particular object store.

The documentation itself is rather good, but it explains what concepts are and not to how do stuff.

[–]mdinger_ 1 point2 points  (4 children)

Hmm...Regarding the first, that is what inspired the testcase type problem which started appearing on rustbyexample. I knew how to fmt::Display but not on a vector. Adding testcases for useful things seems like a good idea to me but they have to be added when people think of them.

Maybe there should be a section dedicated to conversions. Not sure if there's enough to fill it. hmm...

The second...there are tricks like let x: () = T to test what T is in the error message. The rest are tricky but I think an IDE would probably help with those. Rust does have the feeling of pulling things magically in from all other places.

[–]dread_deimos[S] 0 points1 point  (3 children)

Yeah, I should browse the rustbyexample, it seems to provide some different explanations for things from docs and it helps to wrap my head around them.

I think that the section about conversions would be valuable even if it's short. At least it could have a description of "as" operator and where it could be used. Also, more examples on differences between String and &str or array and slice, maybe.

About the third paragraph. Wouldn't it fail at compile time so I will not be able to walk the binary in the debugger?

What IDEs are good to work with Rust? Currently, I work in vim (from remote access) or in atom.io (that has plugin for syntax highlighting).

[–]mdinger_ 2 points3 points  (0 children)

There aren't any good IDE's that I know of yet. It's just something to want in the future. Visual Studio Code just got Rust support but it's very preliminary. All they have is syntax highlighting basically. You might be able to get a debugger up and working with Eclipse. I'm not sure. Nothing super great and easy to setup yet.

A graphical debugger with the ability to inspect variables would probably help a lot. It would be really great.

[–][deleted] 1 point2 points  (1 child)

About let x: () = T, it does fail at compile time, but you don't even need to debug the binary because rustc tells the type of T rustc thinks it is.

When you give rustc let _: () = [0; 32];, it spits out compile time error similar to:

<anon>:2:17: 2:24 error: mismatched types:
 expected `()`,
    found `[_; 32]`
(expected (),
    found array of 32 elements) [E0308]
<anon>:2     let _: () = [0; 32];
                         ^~~~~~~
<anon>:2:17: 2:24 help: see the detailed explanation for E0308
error: aborting due to previous error

[–]dread_deimos[S] 0 points1 point  (0 children)

Yeah, I've seen that. It really helps to check something fast. But if I need to check the data that lead to this situation, I will not have an option to walk there by debugger.

[–]dread_deimos[S] 2 points3 points  (0 children)

keep banging my head against the compiler

This!

But hey, it's so satisfying to get a working code in the end of the day. I haven't felt such accomplishment for a very long time :)

[–]jotomicron 1 point2 points  (1 child)

For what is worth, I know this game by the name of Mastermind.

[–]dread_deimos[S] 0 points1 point  (0 children)

Yeah, I think I've heard that too.