Frustration growing


#1

People,

I have done a fair amount of reading of web pages and watching of Youtube stuff on Rust.

I installed Rust (as root) a couple of nights ago using:

curl -sSf https://static.rust-lang.org/rustup.sh | sh

I have asked a couple of questions here but haven’t had any responses that would help me along.

I just want a little program that will spawn a number of parallel procs. While waiting for something that might be useful, I have tried to run about 10 different example code snippets from different web pages - all containing the use of “spawn” - all of them gave different errors of one sort or another when I tried to compile them - the most common probably being:

error: proc is a reserved keyword

I spent a fair amount of time googling for this with “rust”, “rust language” etc but found nothing useful . .

Is it me or has the language been changing so much that all the examples I can find are out of date and cause errors?

Time for bed I think . .

Regards,

Phil.


#2

Because the language only recently entered into stability, you’ll often find examples online that no longer work. There’s actually an effort underway to fix this (or at least mitigate the issues).

However, if you’re learning the language for the first time, you should absolutely check out The Book, which is Rust’s tutorial. There’s a LOT of information there that will be beneficial for you.

Per the issue that you were facing with spawning procs, check out The Book’s section on Concurrency.


#3

Yes, if the blog post is older than, let’s say… April, it probably won’t work at all.

Proc was removed from the language in the last half of last year.

Have you read any of the official stuff? Both the book and Rust By Example contain up-to-date stuff that should be very helpful.


#4

Google is currently useless for Rust. Besides the other noted references, stack overflow is also a good resource.


#5

@steveklabnik, @mdinger and others (I can only mention two people as a new user!),

Thanks people but it looks like it would be a major effort in time that I haven’t got at the moment to get a program going that would be a fair comparison with my old C++ program (1) - I mainly want to compare speed and numbers of lines of code. Is anyone on this forum interested in being paid to develop this little Rust app? - I imagine it would only take someone who is already competent in Rust a couple of hours - if that . .

Thanks,

Phil.

(1) Population Genetics - an exercise converting a C++ program to Rust


#6

By most accounts, Rust is considered complicated to learn so if you’re trying for a quick fix, you may be disappointed. Also, the compiler is strict which can be a downside particularly at the beginning when the compiler fights you at every step. In the long run, the compiler is usually very helpful which can make things very fast when you just want to get the code running because the compiler is usually very specific about where each mistake is and what the problem is.

Either way, if you truly want to evaluate the language, you will have to invest the time. Otherwise, the evaluation wouldn’t be yours but someone else’s.


#7

@mdinger,

I think you are right about all of that - it would be nice if I did have the time and was at a different stage of the game . . oh well . .

I realise it is very early days so I guess that means that there are very few people available for consulting about Rust?

Thanks,
Phil.


#8

Regarding that specifically, you might be more successful posting on reddit/rust specifically asking for a contributor to translate some source code (which hopefully you would provide). An experienced hand might happily do it or someone who is looking for a project. You never know.


#9

@mdinger,

Thanks for that - I appreciate it. I have not looked for tech people before on Reddit so it will be a useful exercise.

Regards,
Phil.