1 / 104

How to Rust

How to Rust. Rust Experience. Never Programmed Rust Dabbled with Rust Wrote project with Rust. The Rust Programming Language. Rust Compiler installation: Step [1 of 13]. Windows https://win.rustup.rs / Mac/Linux curl https://sh.rustup.rs –sSf | sh.

leora
Download Presentation

How to Rust

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. How to Rust

  2. Rust Experience Never Programmed Rust Dabbled with Rust Wrote project with Rust

  3. The Rust Programming Language

  4. Rust Compiler installation: Step [1 of 13] Windows https://win.rustup.rs/ Mac/Linux curl https://sh.rustup.rs –sSf | sh

  5. Rust Compiler installation: Step [2 of 17] Press Return Wait Press Return

  6. Rust Compiler installation: Step [3 of 15]

  7. Step [4 of 21]: just kidding, you‘re done

  8. Hello Rust

  9. Editor Wars

  10. Visual Studio Code Tutorial

  11. You should see this:

  12. Be patient

  13. Running from vscode

  14. What‘s going on? The starting point of any Rust program is the „main“ function A Function is denoted by the keyword „fn“ The main function has no arguments A standard library macro to help you write stuff to the command line Strings are declared with double quotes

  15. Rust doesn‘t have variables Placeholder like %d in C format strings

  16. Bindings are immutable by default

  17. Mutable binding

  18. Variable names

  19. IDE Features

  20. Find all References

  21. Find all References

  22. Rename Symbol

  23. Rename Symbol

  24. Rename Symbol

  25. Show type of $anything

  26. Builtin Types

  27. Variables with explicit types

  28. Functions Function names, like variable names, are snake_case A Function is denoted by the keyword „fn“ Arguments are declared like variables, but must have an explicit type The return type is declared after the „arrow“ (->) like in C++11 No return statement needed Functions look like Mathematical functions

  29. Function calls

  30. Inspect function type through tooltip

  31. Control Flow: if

  32. Common C-mistakes

  33. Common C-Mistakes

  34. Excercise

  35. Interlude: clippy

  36. Clippy

  37. Fibonacci improvements

  38. Better fibonacci

  39. Learn to trust …

  40. Aggregate Types

  41. Aggregate Types: Tuples

  42. Methods

  43. Loops

  44. For loops

  45. References

  46. The Borrow Checker

  47. Local vs Global analysis

  48. Local vs Global analysis

  49. Function boundaries

More Related