Hi everyone, I just chose to learn rust. Ive got experience with Linux and I know some html and CSS. I know rust is different but id really like to learn it. Any advice?
Welcome! I think it is possible to learn Rust as your first programming language. But it will be quite challenging and if you wanted to learn a simpler language first, no one would blame you for that. For example, Typescript and Go are easier to learn, and both have static type systems, so they have at least some similarity to Rust.
Have you seen the learning resources on the Rust web page?:
Cheers mate, yes I'm reading the book.
Sounds good. If you have questions while reading the book, feel free to post here.
If you use Reddit, it may be also useful to ask on r/rust or r/learnrust, where there is a lot of people possibly younger people than here.
Remember though that not all advice is the best on reddit.
I am reasonably new and it has been challenging for me indeed, but everyone is different.
I think that considering what exactly you would like to do with it and how long are you willing to spend on it etc could be important questions to think about.
I've got Reddit but I use it for maths. I am finishing high school, just got a year left, and I've always loved maths and computers. So now I thought that it would be fun to learn rust and Im going for it. I'll join /rust and be careful of who I listen to. Thanks mate
html and CSS are way different than rust.
The fact that html and CSS are very complicated and difficult and you can figure them out give me hope that your brain can figure out rust.
I suggest stalking this forum for a while. There is a lot to learn here. And of course ask questions yourself if you get stuck.
p.s. Read the book.
I am totally new to Rust, I need guidance from an experienced Rust programmer. I need to take the firmware from
and compile it into an executable file that I can install on a Texas Instruments TM4C129 microprocessor via the JTAG port. It seems to have been written for Rust 1.32 version.
The overall introduction to the project is at
This project has not been updated in over six years and seems to be abandoned by its original creator.
Do not be discouraged if you struggle with the borrow checker (terms like lifetimes, move semantics, and borrowing are all under the same borrow-checker umbrella). This mechanism is the main distinguisher between Rust and nearly all other languages, so it is natural for it to have a steep learning curve since it have effects throughout the entire Rust ecosystem. It may take a bit, but once you get it, you'll really get it. It's like 20% of the language, but 80% of the initial learning.
There's documentation focused on embedded development here, in case you haven't already found it.
I'd start by checking that your specific Cortex CPU is supported by a cross-compiler, installing the toolchain, and making a basic "hello, world" equivalent to verify that everything works as expected.
1.32 is pretty old; it's the 2018 Edition. You must probably state that in the Cargo.toml file in case the code isn't compatible with the current edition, by adding edition = '2018' in the [package] section.
PS: If you encounter problems, start new threads of your own. That'll avoid any confusion. ![]()
Hi everyone, I'm a new comer to this forum and an almost beginner in Rust.
In the past, I worked in Fortran, Basic and Pascal. I also learned C on a Unix system in the 1990s'
Since 2019, I started again to update my knowledge and program in C. I also learned Python and some C++
My skills about the OOP are better in Python than C++. I'm not good about the STL in C++.
I learned html 3 in the 1990s, and html 5 and css 3 recently.
Less than one year ago, I started to learn Rust.
One of my problems is that I'm blind and often have problems to find the documentations.
I have the Rust tutorial both in French and English (my native language is French)
I also have problems to access the github and I don't know how to use git.
Surprizingly, I use Google Gemini and it helps me for documentation.
However, I suggest not to trust Gemini if you want to ask it to write Rust code for you.
I really like Rust and have written close to 70 programs in Rust but with some basic knowledge.
I have to admit that I skipped a few chapters and I do fairly well with vectors.
I registered to the French forum OpenClassrooms, ZesteDeSavoir and CommentCaMarche.
I never posted on StackOverflow but found many things on it.
I also registered to the problem sites DéfiTuring and ProjectEuler.
Can you help me to understand more the way to access the documentation?
Thanks in advance.
P.S. I have the same pseudonym on all the places where I registered.
Could you provide further information on what problems are you facing when searching for the documentation? Like if it's an accessibility problem, lack of documentation available in your native language, etc.
Also, which documentation are you having the most problems with?: API docs, "the book", etc. Are the problems are related to screen reader compatibility?
Hi,
Even if I mentionned it, it's not really a matter of my native language. Especially because I can use the Google Translate.
Most of the time, I can understand directly in english.
When I do a search on Google about "rust documentation", I get the following link:
I have rustdoc but it seems I don't know how to use it.
Suppose I want to know the options in println!(...) within the {...}, how or where I would find them?
I just found this link:
Should I just follow the links within the pages like any other web page?
Or what is in the standard library std, such as std::time?
Are there standard libraries other than std ?
Those may be advanced features but there are lines beginning with a @, I think I saw it on stackoverflow.
Or how can I find the documentation about the itertools::Itertools? Will I find it on github?
Where can I find a good list of such external libraries?
I know how to use the dependancy file when I use cargo.
But where to find the appropriate version of each crate I want to use?
My main interest is to write programs to solve problems such as those found in Project Euler or Défi Turing.
It's my pleasure to find efficient algorithms in an efficient (and safe) language.
Rust is good to detect index overflow bugs as well as arithmetic overflow that I don't have in C.
And the efficiency of the compiled code can be compared to the efficiency of C or C++.
I have rustdoc but it seems I don't know how to use it.
rustdoc is the tool for building documentation, not for reading it. For building doc you normally use cargo doc, which calls rustdoc.
Should I just follow the links within the pages like any other web page?
Yes, you found the correct place, and it is a normal web page (hopefully friendly to screen readers, but I don't really know).
If you are on any page in the Rust API doc (for the std library or any other crate), you can press the letter S to go to the search box. Typing a Rust identifier of any kind there will give you a list of matches.
Or what is in the standard library std, such as std::time?
Are there standard libraries other than std ?
This is the std library that is included with Rust. You don't have to install it or add it as a dependency.
There are also core and alloc libraries, however, these are subset of std. They exist for cases where std cannot be used, such for embedded or OS development. They also do not need to be installed or have dependencies added.
Those may be advanced features but there are lines beginning with a @, I think I saw it on stackoverflow.
I'm not sure.
Or how can I find the documentation about the itertools::Itertools? Will I find it on github?
Where can I find a good list of such external libraries?
itertools is an external crate, i.e., a crate that is not in the std library. All external crates are hosted on https://crates.io/crates.io and are downloaded from there by cargo when they are installed.
The documentation for a crate is hosted on https://docs.rs/, for example, https://docs.rs/itertools/latest/itertools/. There is a menu at the top of the docs page for a crate, containing links to the crates.io page for that crate and to the git repository for the crate, so this is a good way to navigate to everything about a crate.
In addition there is https://lib.rs/. This is a non-official but commonly used directory, maintained by a Rust user, of most crates that are on crates.io. It has a very nice search facility. It doesn't host the crates themselves, it only contains the metadata for the crate and a search index.
Crates have a git repository, although it is not necessarily on github -- there are also other semi-popular git hosting services as https://gitlab.com/ and https://codeberg.org/. The links on the crate's doc page will help to locate the git repo as I mentioned.
But where to find the appropriate version of each crate I want to use?
The crate's docs.rs page, its crates.io page, and its lib.rs page all contain the current version of the crate that can be used in your Cargo.toml.
Sorry, I was mmore busy recently because of personal reasons. Thanks to everyone foryour replies.
I will study everything very carefully.
This one in particular can be easy to overlook even if you have found the page for println already; on that page, the important sentence is this one:
This macro uses the same syntax as
format!, but writes to the standard output instead. Seestd::fmtfor more information.
The mention of “std::fmt” there is a link to the module documentation of std::fmt, the fmt module of the standard library, i.e. of the std crate, and the page is fairly in-depth on the formatting strings syntax that macros like println! (which prints some formatted text) or format! (which creates a value of type String containing the formatted text) and a few more macros support.
All crates besides std need to be added as dependencies manually in order to be available. (Well, std and very few other special cases, e.g. there’s some stripped-down versions of std called alloc and core for developing for embedded systems without a full operating system; and there’s the proc_macro crate which is available when writing a procedural macro).
One convenient way to find the appropriate (i.e. latest) version of a crate is by adding it to your project with the cargo add command. E.g. if you want to experiment with nothing but std and itertools, you can create a project with cargo new name-of-test-project; then navigate there with cd name-of-test-project, and then you can start adding dependencies, with simple commands like cargo add itertools
cargo add itertools
Updating crates.io index
Adding itertools v0.14.0 to dependencies
Features:
+ use_alloc
+ use_std
Updating crates.io index
Locking 2 packages to latest Rust 1.87.0 compatible versions
the output here tells us also about 2 crate features that were activated implicitly, as indicated by the + sign (implicitly because they're default features).
This command has now added the dependency to Cargo.toml, which looks like
cat Cargo.toml
[package]
name = "name-of-test-project"
version = "0.1.0"
edition = "2024"
[dependencies]
itertools = "0.14.0"
now. Some other crates often have opt-in features that can be important to fully explore their functionality. For example if we
cargo add tokio
Updating crates.io index
Adding tokio v1.45.1 to dependencies
Features:
- bytes
- fs
- full
- io-std
- io-util
- libc
- macros
- mio
- net
- parking_lot
- process
- rt
- rt-multi-thread
- signal
- signal-hook-registry
- socket2
- sync
- test-util
- time
- tokio-macros
- tracing
- windows-sys
Updating crates.io index
Locking 21 packages to latest Rust 1.87.0 compatible versions
Adding addr2line v0.24.2
Adding adler2 v2.0.1
Adding backtrace v0.3.75
Adding cfg-if v1.0.1
Adding gimli v0.31.1
Adding libc v0.2.174
Adding memchr v2.7.5
Adding miniz_oxide v0.8.9
Adding object v0.36.7
Adding pin-project-lite v0.2.16
Adding rustc-demangle v0.1.25
Adding tokio v1.45.1
Adding windows-targets v0.52.6
Adding windows_aarch64_gnullvm v0.52.6
Adding windows_aarch64_msvc v0.52.6
Adding windows_i686_gnu v0.52.6
Adding windows_i686_gnullvm v0.52.6
Adding windows_i686_msvc v0.52.6
Adding windows_x86_64_gnu v0.52.6
Adding windows_x86_64_gnullvm v0.52.6
Adding windows_x86_64_msvc v0.52.6
Which updates the Cargo.toml file’s bottom section to
[dependencies]
itertools = "0.14.0"
tokio = "1.45.1"
It lists a lot if inactive features (indicated by the - sign) – and it also talks about transitive dependencies being added and “locked” which isn’t too relevant anyway. The most effective way of turning on more features of tokio would be the “full” feature, but that’s no general principle.
The best consistent place to find out about features is probably lib.rs, for tokio this would be the URL https://lib.rs/crates/tokio/features. Most crates do (well.. should at least) also talk about their crate features on their documentation pages, e.g. https://docs.rs/tokio/latest/tokio/#feature-flags is a sub-heading on the main / top-level crate documentation page for tokio on docs.rs.
With this out of the way, we can re-run cargo add now and tell it which features we want:
cargo add tokio --features=full
Updating crates.io index
Adding tokio v1.45.1 to dependencies
Features:
+ bytes
+ fs
+ full
+ io-std
+ io-util
+ libc
+ macros
+ net
+ parking_lot
+ process
+ rt
+ rt-multi-thread
+ signal
+ signal-hook-registry
+ socket2
+ sync
+ time
+ tokio-macros
- mio
- test-util
- tracing
- windows-sys
Locking 20 packages to latest Rust 1.87.0 compatible versions
Adding autocfg v1.5.0
Adding bitflags v2.9.1
Adding bytes v1.10.1
Adding lock_api v0.4.13
Adding mio v1.0.4
Adding parking_lot v0.12.4
Adding parking_lot_core v0.9.11
Adding proc-macro2 v1.0.95
Adding quote v1.0.40
Adding redox_syscall v0.5.13
Adding scopeguard v1.2.0
Adding signal-hook-registry v1.4.5
Adding smallvec v1.15.1
Adding socket2 v0.5.10
Adding syn v2.0.104
Adding tokio-macros v2.5.0
Adding unicode-ident v1.0.18
Adding wasi v0.11.1+wasi-snapshot-preview1
Adding windows-sys v0.52.0
Adding windows-sys v0.59.0
which updated the dependencies section in Cargo.toml to
[dependencies]
itertools = "0.14.0"
tokio = { version = "1.45.1", features = ["full"] }
If you want to remove a dependency again, there is cargo remove, so you could run cargo remove itertools or cargo remove tokio, etc.
The nice next thing now is that you can now look at documentation locally, too.
I.e.: In this project where we have added itertools and tokio, you can execute cargo doc --open
which outputs some stuff while building
cargo doc --open
Compiling libc v0.2.174
Compiling proc-macro2 v1.0.95
Checking unicode-ident v1.0.18
Compiling autocfg v1.5.0
Compiling parking_lot_core v0.9.11
Checking smallvec v1.15.1
Checking scopeguard v1.2.0
Checking cfg-if v1.0.1
Documenting unicode-ident v1.0.18
Documenting smallvec v1.15.1
Documenting scopeguard v1.2.0
Documenting cfg-if v1.0.1
Checking pin-project-lite v0.2.16
Checking either v1.15.0
Checking bytes v1.10.1
Documenting either v1.15.0
Documenting bytes v1.10.1
Documenting pin-project-lite v0.2.16
Checking itertools v0.14.0
Compiling lock_api v0.4.13
Documenting libc v0.2.174
Documenting proc-macro2 v1.0.95
Documenting lock_api v0.4.13
Checking quote v1.0.40
Documenting itertools v0.14.0
Checking syn v2.0.104
Documenting quote v1.0.40
Checking socket2 v0.5.10
Checking signal-hook-registry v1.4.5
Checking mio v1.0.4
Checking parking_lot v0.12.4
Documenting syn v2.0.104
Documenting parking_lot_core v0.9.11
Documenting socket2 v0.5.10
Documenting mio v1.0.4
Documenting signal-hook-registry v1.4.5
Documenting parking_lot v0.12.4
Documenting tokio-macros v2.5.0
Compiling tokio-macros v2.5.0
Documenting tokio v1.45.1
Checking tokio v1.45.1
Documenting name-of-test-project v0.1.0 (/home/frank/name-of-test-project)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.18s
Opening /home/frank/name-of-test-project/target/doc/name_of_test_project/index.html
and eventually opens the finished documentation in a web browser locally. If you re-run it, it will skip re-doing extra work that it already did before, so then it will be faster. [Without the --open flag it wouldn't do the last step of opening your browser; but that can make sense if you already have the browser open - just don't forget to refresh the browser to see any changes actually apply. If you forgot the --open just run it again afterwards, and as mentioned it will be done immediately anyway.]
Now you can use the search field there to search through all of all of tokio and itertools simultaneously, as well as through the documentation of anything you have defined locally in your project. And apparently transitive dependencies are also shown, even though you can’t access them directly without adding a direct dependency on them, too. (But it can be a fun way to come across new crates to look at, by looking at what dependencies some popular crates build on, and thus some of those crates might also be good or popular or important ones to learn about eventually.)
The std documentation is not directly included with these other locally generates ones, unfortunately. Though if you have rustup installed (and you ought to have installed Rust using it), then you at least have one local copy of the whole std documentation available locally, too; which can even somewhat be searched and accessed quickly from your terminal, too. For example running
rustup doc 'println'
this opens the local copy of the std docs on println directly in your browser, and for example
rustup doc 'std::fmt'
this works, too.
Another thing to be aware of is that the standard library documentation even have dedicated pages about the language’s keywords. E.g. if you come across the impl keyword in a position where you're not quite sure what it means, then inserting impl into the search box on doc.rust-lang.org/std/, or even trying rustup doc 'impl' (or rustup doc impl without the quotes) takes you to an overview/introduction/quick-reference page for that keyword that lists various meanings of impl, some examples, and some links for further information.
There's also rustup doc --book to access your local copy of the tutorial book “The Rust Programming Language” (which also has a full-text search function built-in which you can access quickly with the "s" key).
I really have no idea how useful or not any these things are to you for accessibility, but at least I always thought these things are good to know about.
As for top-level pages, we have two different ones available by the way. Besides the one you found, there’s also rust-lang.org/learn.
Thanks a lot again for all the information. Indeed I will have to study everything carefully!
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.