A tour of rust's language features

Overview

Tour of Rust

Welcome to the source repo of Tour of Rust.

Goals

This project is meant to give an experienced programmer a swift introduction to Rust as an alternative to reading lengthy book style documentation.

  • Chapter 1 - The Basics
  • Chapter 2 - Basic Control Flow
  • Chapter 3 - Basic Data Structure Types
  • Chapter 4 - Generic Types
  • Chapter 5 - Ownership & Borrowing Data
  • Chapter 6 - Text
  • Chapter 7 - Object Oriented Programming
  • Chapter 8 - Smart Pointers
  • Chapter 9 - Project Organization and Structure

Content goals:

  • Chapter 1-4 should give you a strong taste of Rust's aesthetic
  • Chapter 1-6 should give a person from C a good idea how their ideas translate
  • Chapter 1-8 should give a person from C++ a good idea how their ideas translate
  • Chapter 9+ should talk about Rust specific concepts that doesn't fit well into the above

This project also aims to provide this book in as many languages as possible.

Contributors

Looking for translators!

If you would like to contribute translations in a language that doesn't exist yet. Feel free to make a PR!

Look for your appropriate language under the lessons folder. Each chapter has its own file. You can modify an existing chapter's content or if there is one you'd like to translate from the english lessons, copy that chapter file over and modify it's content to your own language. Each page has various properties.

  • title - this would be your localized page's title
  • content_markdown - this would be your localized page's content as markdown using shodown markdown
  • code (optional) - this would be your localized page's code. This is the "embedded link" generated from https://play.rust-lang.org/ when you hit the "Share" button. Be sure your run the "rustfmt" tool! If you don't provide code, a page will fallback onto an english version of code (if it exists).
- title: Capítulo 3 - Conclusión
  content_markdown: |
    ¡Rust tiene algunos increíbles ** punteros **!

    * A
    * `let`
    * C
  code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&code=fn%20main()%20%7B%7D%0A

Lastly, there is a file for common words you should fill out your localized translations of for deeper experience of the site.

How to run the project locally

To run the site locally you need to install yq. There are several projects with the name yq, this project uses this one.

Run yarn to install javascript dependencies.

After installing the dependencies use make to launch the site. You will need to restart the server every time to see the changes you've made. Windows users should use make.bat instead.

Releases

Release 5 - May 30, 2020

  • Chapter 6 released on text in English, Occidental
  • Chapter 5 released in French and Brazillian Portuguese
  • Chapter 4 released in Chinese and Spanish
  • Chapter 3 released in French
  • Minor fixes
  • Chapter 2 of Tour of WebAssembly released

Release 4 - May 30, 2020

  • Chapter 5 released on ownership and sharing
  • Chinese transalations chapter 1-3
  • French translations for chapter 1-3
  • Brazillian portuguese translations for chapter 2-4
  • Spanish translations for chapter 3
  • Starting new section for WebAssembly

Release 3 - May 23, 2020

  • Chapter 4 released on generic data structures
  • Spanish for Chapter 2
  • Chapter 1 in brazillian portuguese
  • Updates for german and russian
  • New pages and rewrites and reordering

Release 2 - May 16, 2020

  • Deutsch, English, Interlingue, Русский translations for chapter 2
  • Spanish for chapter 1
  • New markdown formatting for pages

Release 1 - May 10 2020

  • Deutsch, English, Interlingue, Русский translations for chapter 2
  • Deutsch, Interlingue, Русский translations for chapter 1
  • Domain name setup
  • Mobile improvements
  • Deeper localization capabilites of generator

Release 0 - May 3rd 2020

  • Chapter 1

Credit

This tutorial format and many of the examples were inspired by the wonderful Tour of Go

Comments
  • Translation to Hungarian

    Translation to Hungarian

    Apologies, I only saw that you also need to make an issue after I opened #214 . Well anyway, most details are in the pull request, but the gist of it is that I wish to start translating this project in my language.

    opened by Nemin32 6
  • format code according to rust style

    format code according to rust style

    Run rustfmt through the code, 4 spaces, 100 chars width, there should also be space in between parenthesis and curly braces. This allow more consistency with other rust code and easier to read.

    https://github.com/rust-dev-tools/fmt-rfcs/blob/master/guide/guide.md

    opened by pickfire 6
  • [HU] Clean up

    [HU] Clean up

    This PR is a work in progress aimed to make the Hungarian translation more friendly and less verbatim. While not nearly ready, it's public so that others may review the changes.

    opened by bugadani 5
  • Left and right arrows to change page does not work if there is a playground on the page

    Left and right arrows to change page does not work if there is a playground on the page

    I do not know if anyone has the same problem but I cannot go to previous/next page if there is a Rust playground on the page.

    Once the playground is loaded, it get the focus and right/left arrows can only be used to navigate in the code.

    Can't we just not focus on the playground when we load the page?

    opened by mgemard 5
  • [WASM] chapter 1:  typo in css styles font-family

    [WASM] chapter 1: typo in css styles font-family

    On main.html, the font-family displayed in the header is "san-serif" instead of "sans-serif"

    Seen on FR and EN translations for "1+1", "Importing Functions", "Logging Text". Maybe beyond these. I didn't verified for other translations but we need to check and fix them.

    opened by VincentFoulon80 5
  • Chapter 3

    Chapter 3

    Good news! I was able to get Chapter 3 done this weekend. This was by far one of the most challenging chapters i've had to research and write thus far.

    Also we have lots of new abilities of our generator!

    We can now write our lessons in markdown and use multi-line strings in yaml :tada: :tada: :tada:

    This is now way easier to write pages in.

    Also, i've been working on a new way I can publish beta content to the website that users can't find, but you all will be able to see in preview.

    With that said, I can present to you all chapter 3 content now via link!

    https://tourofrust.com/beta_22_en.html

    Happy translating!

    @jassler @Dhghomon @knightpp @albatraduce

    opened by richardanaya 5
  • Chapter 4 in Hungarian

    Chapter 4 in Hungarian

    I like the new system, however, I'd like to ask for a bit of clarification. How should we exactly format these yaml files? When i started editing chapter 4, I saw a lot of seemingly senseless line-breaks in the original version. I ultimately chose to go with line-breaks only where I actually want them to happen.

    Anyway, pull introduces Chapter 4 in Hungarian.

    opened by Nemin32 4
  • Question about generics

    Question about generics

    In What Are Generic Types?

    You say in a comment:

    // Note: by using generic types here, we create compile-time created types // making our code-size bigger. Turbofish let's us be explicit.

    Did you mean smaller instead of bigger?

    opened by mgemard 4
  • discussion about immutability

    discussion about immutability

    You say here

    • immutable - the location in memory can only be read

    Infering that the location in memory can not be written. Technicaly, this is not 100% correct:

    Immutability does not imply that the object as stored in the computer's memory is unwriteable. Rather, immutability is a compile-time construct that indicates what a programmer can do through the normal interface of the object, not necessarily what they can absolutely do (for instance, by circumventing the type system or violating const correctness in C or C++).

    Taken from Immutable object on wikipedia

    I am not sure if this apply to rust though.

    Just wanted to let you know.

    opened by mgemard 4
  • Turkish language support for the Tour of Rust site

    Turkish language support for the Tour of Rust site

    Hello Richard, We would like to announce that we have started to translate Tour of Rust documents into Turkish. The translated parts are as follows: chapter_0.yaml (Turkish language added for all languages, made chapter_1.yaml common_wors.yaml and the required readme.md documents We wish you good work

    opened by RustDili 3
  • WebAssembly spelling

    WebAssembly spelling

    I believe the right way to spell WebAssembly is as it is, not Web Assembly (two words).

    I have a PR drafted to fix this and I'd submit if you dont mind.

    opened by OAyomide 3
  • Fix a typo in a Japanese translation of chapter 7.

    Fix a typo in a Japanese translation of chapter 7.

    Thank you for making such an awesome tutorial!

    I am learning the Rust language through the tour, and found minor typos in the Japanese translation. (There is a redundant "0" before "Rust", and there is a redundant a space character in other place.)

    This PR will just remove these.

    opened by tmash06 0
  • chore(deps): bump json5 and tsconfig-paths

    chore(deps): bump json5 and tsconfig-paths

    Bumps json5 and tsconfig-paths. These dependencies needed to be updated together. Updates json5 from 1.0.1 to 2.2.3

    Release notes

    Sourced from json5's releases.

    v2.2.3

    v2.2.2

    • Fix: Properties with the name __proto__ are added to objects and arrays. (#199) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (#295).

    v2.2.1

    • Fix: Removed dependence on minimist to patch CVE-2021-44906. (#266)

    v2.2.0

    • New: Accurate and documented TypeScript declarations are now included. There is no need to install @types/json5. (#236, #244)

    v2.1.3 [code, diff]

    • Fix: An out of memory bug when parsing numbers has been fixed. (#228, #229)

    v2.1.2

    • Fix: Bump minimist to v1.2.5. (#222)

    v2.1.1

    • New: package.json and package.json5 include a module property so bundlers like webpack, rollup and parcel can take advantage of the ES Module build. (#208)
    • Fix: stringify outputs \0 as \\x00 when followed by a digit. (#210)
    • Fix: Spelling mistakes have been fixed. (#196)

    v2.1.0

    • New: The index.mjs and index.min.mjs browser builds in the dist directory support ES6 modules. (#187)

    v2.0.1

    • Fix: The browser builds in the dist directory support ES5. (#182)

    v2.0.0

    • Major: JSON5 officially supports Node.js v6 and later. Support for Node.js v4 has been dropped. Since Node.js v6 supports ES5 features, the code has been rewritten in native ES5, and the dependence on Babel has been eliminated.

    • New: Support for Unicode 10 has been added.

    • New: The test framework has been migrated from Mocha to Tap.

    • New: The browser build at dist/index.js is no longer minified by default. A minified version is available at dist/index.min.js. (#181)

    • Fix: The warning has been made clearer when line and paragraph separators are

    ... (truncated)

    Changelog

    Sourced from json5's changelog.

    v2.2.3 [code, diff]

    v2.2.2 [code, diff]

    • Fix: Properties with the name __proto__ are added to objects and arrays. (#199) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (#295).

    v2.2.1 [code, diff]

    • Fix: Removed dependence on minimist to patch CVE-2021-44906. (#266)

    v2.2.0 [code, diff]

    • New: Accurate and documented TypeScript declarations are now included. There is no need to install @types/json5. (#236, #244)

    v2.1.3 [code, diff]

    • Fix: An out of memory bug when parsing numbers has been fixed. (#228, #229)

    v2.1.2 [code, diff]

    • Fix: Bump minimist to v1.2.5. (#222)

    v2.1.1 [code, [diff][d2.1.1]]

    ... (truncated)

    Commits
    • c3a7524 2.2.3
    • 94fd06d docs: update CHANGELOG for v2.2.3
    • 3b8cebf docs(security): use GitHub security advisories
    • f0fd9e1 docs: publish a security policy
    • 6a91a05 docs(template): bug -> bug report
    • 14f8cb1 2.2.2
    • 10cc7ca docs: update CHANGELOG for v2.2.2
    • 7774c10 fix: add proto to objects and arrays
    • edde30a Readme: slight tweak to intro
    • 97286f8 Improve example in readme
    • Additional commits viewable in compare view

    Updates tsconfig-paths from 3.9.0 to 3.10.1

    Changelog

    Sourced from tsconfig-paths's changelog.

    [3.10.1] - 2021-07-06

    Fixed

    • Add register.js to published files

    [3.10.0] - 2021-07-06

    Added

    • feat(tsconfig-loader): extends config from node_modules (#106). Thanks to @​zorji for this PR!

    Fixed

    Commits

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • chore(deps): bump got and nodemon

    chore(deps): bump got and nodemon

    Removes got. It's no longer used after updating ancestor dependency nodemon. These dependencies need to be updated together.

    Removes got

    Updates nodemon from 2.0.7 to 2.0.20

    Release notes

    Sourced from nodemon's releases.

    v2.0.20

    2.0.20 (2022-09-16)

    Bug Fixes

    • remove postinstall script (e099e91)

    v2.0.19

    2.0.19 (2022-07-05)

    Bug Fixes

    v2.0.18

    2.0.18 (2022-06-23)

    Bug Fixes

    • revert update-notifier forcing esm (1b3bc8c)

    v2.0.17

    2.0.17 (2022-06-23)

    Bug Fixes

    v2.0.16

    2.0.16 (2022-04-29)

    Bug Fixes

    • support windows by using path.delimiter (e26aaa9)

    v2.0.15

    2.0.15 (2021-11-09)

    Bug Fixes

    v2.0.14

    ... (truncated)

    Commits

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Suggestion: Exercises

    Suggestion: Exercises

    I think it would be a great idea to have each section end with a couple of exercises making use of the playground. Maybe something concise like code that doesn't function that you just need to make compile, or having most of the boilerplate setup and just working on the things relevant to the section.

    opened by jfaz1 0
  • The explanation of Structures is not clear

    The explanation of Structures is not clear

    A field is simply a data value associated with a data structure. Its value can be of a primitive type or a data structure. First explain the difference between primitive type & data structure.

    opened by khanra17 0
Owner
RICHΛRD ΛNΛYΛ
Data Engineer, Code Philosopher, & Robot Psychologist.
RICHΛRD ΛNΛYΛ
Rust language bindings for TensorFlow

TensorFlow Rust provides idiomatic Rust language bindings for TensorFlow. Notice: This project is still under active development and not guaranteed to

null 4.1k Jan 1, 2023
Rust language bindings for Faiss

Faiss-rs This project provides Rust bindings to Faiss, the state-of-the-art vector search and clustering library. Installing as a dependency Currently

Eduardo Pinho 86 Jan 7, 2023
[WIP] An experimental Java-like language and it's virtual machine, for learning Java and JVM.

Sky VM An experimental Java-like language and it's virtual machine, for learning Java and JVM. Dependencies Rust (rust-lang/rust) 2021 Edition, dual-l

Kk Shinkai 2 Jan 3, 2022
Masked Language Model on Wasm

Masked Language Model on Wasm This project is for OPTiM TECH BLOG. Please see below: WebAssemblyを用いてBERTモデルをフロントエンドで動かす Demo Usage Build image docker

OPTiM Corporation 20 Sep 23, 2022
Rust language bindings for the LIBLINEAR C/C++ library.

liblinear-rs Rust bindings for the liblinear C/C++ library. Provides a thin (but rustic) wrapper around the original C-interface exposed by the librar

Madeesh Kannan 8 Sep 22, 2022
Rust-like syntax for OpenGL Shading Language

Rust-like syntax for GLSL glassful translates a small subset of Rust to OpenGL Shading Language. Besides one's personal preferences regarding Rust-lik

Keegan McAllister 158 Sep 22, 2022
🐉 Making Rust a first-class language and ecosystem for GPU shaders 🚧

?? rust-gpu Rust as a first-class language and ecosystem for GPU graphics & compute shaders Current Status ?? Note: This project is still heavily in d

Embark 5.5k Jan 9, 2023
Deduplicating Training Data Makes Language Models Better

Deduplicating Training Data Makes Language Models Better This repository contains code to deduplicate language model datasets as descrbed in the paper

Google Research 431 Dec 27, 2022
Framework and Language for Neuro-Symbolic Programming

Scallop Scallop is a declarative language designed to support rich symbolic reasoning in AI applications. It is based on Datalog, a logic rule-based q

null 27 Dec 14, 2022
A lesson in Humility - or how a boy teaches himself a new programming language.

Learning Rust - A Lesson in Humility J. M. Barrie - Author of Peter Pan Life is a long lesson in humility... and so is learning Rust. I tried to teach

Gary McDougall 6 Nov 1, 2022
A collection of CC-BY-SA course material to teach the Rust programming language, in different formats, levels, and focus points

A collection of CC-BY-SA course material to teach the Rust programming language, in different formats, levels, and focus points. Contact me for remote and on-site trainings!

Katharina Fey 13 Apr 13, 2023
A programming language written in an "easy to understand" way

Trees Trees は、ブロックプログラミング言語で、以下の特徴を備えています! 分かりやすい (easy to understand) 読みやすい (readable) 曖昧性がない (clear) ┌─────┐ │print│ └───┬─┘

Snowman-s 34 Jul 5, 2024
🌾 High-performance Text processing library for the Thai language, built with Rust and exposed as a Python package.

Thongna ?? Thongna (ท้องนา) is a high-performance text processing library for the Thai language, built with Rust and exposed as a Python package. Insp

fr4nk 3 Aug 17, 2024
A programming environment that aims to help people learn how to program in JavaScript, while giving them a tour on how old computers and their limitations used to be.

This repository is for the new under renovation rewrite of the LIKO-12 project. The legacy version with the original stars and contributions is still

null 1k Jan 5, 2023
A higher dimensional raytracing prototype with non-euclidean-like features

euclider A higher-dimensional "non-euclidean" ray tracing prototype written in Rust. Dual-licensed under MIT or the UNLICENSE. Installation Install th

Jakub Hlusička 190 Dec 11, 2022
Monad/MonadIO, Handler, Coroutine/doNotation, Functional Programming features for Rust

fpRust Monad, Functional Programming features for Rust Why I love functional programming, Rx-style coding. However it's hard to implement them in Rust

null 98 Dec 24, 2022
A cross-platform graphical process/system monitor with a customizable interface and a multitude of features

A cross-platform graphical process/system monitor with a customizable interface and a multitude of features. Supports Linux, macOS, and Windows. Inspired by both gtop and gotop.

Clement Tsang 5.8k Jan 8, 2023
A safe implementation of the secure remote password authentication and key-exchange protocol (SRP), SRP6a and legacy are as features available.

Secure Remote Password (SRP 6 / 6a) A safe implementation of the secure remote password authentication and key-exchange protocol (SRP version 6a). Ver

Sven Assmann 10 Nov 3, 2022
The nightly_crimes!{} macro commits horrible crimes to allow you to enable nightly features on the stable compiler.

The nightly_crimes!{} macro commits horrible crimes to allow you to enable nightly features on the stable compiler.

Mara Bos 151 Dec 16, 2022
A versatile and efficient proxy framework with nice features suitable for various use cases.

A versatile and efficient proxy framework with nice features suitable for various use cases.

null 1.7k Jan 9, 2023