presentation-rust-webapps/rust_web.org
2020-12-21 14:09:32 +01:00

4.3 KiB

Rust, Rocket and Diesel

Rust

What is Rust?

#+LaTeX:∈cludegraphics[width = 0.65\textwidth]{img/Bruine_roest_op_tarwe_(Puccinia_recondita_f.sp._tritici_on_Triticum_aestivum).jpg}

Rust, the language

  • About 10 years old (2010)
  • Memory safe without gcing, optional ref counting
  • Ownership, lifetimes, traits
  • Variables are immutable by default and can be shadowed
  • Performance of idiomatic Rust is comparable to the performance of idiomatic cpp

What are we going to use?

Definitely

Maybe

  • anyhow
  • lettre
  • sha3
  • serde
  • chrono

How to install

Install Rust

$ curl --proto '=https' --tlsv1.2 -sSf \
  https://sh.rustup.rs | sh

Install nightly Rust (needed for Rocket)

$ rustup toolchain install nightly

Install rustfmt (code formatter)

$ rustup component add rustfmt

Install clippy (linter and static code analysis)

$ rustup component add clippy

Rocket

What is Rocket?

Rocket is a web framework for Rust that makes it simple to write fast, secure web applications without sacrificing flexibility, usability, or type safety.

Features

Col left
  • Type Safe
  • Extensible
  • Templating
  • Cookies
Col right
  • Streams
  • Testing (Unit tests)
  • Typed URIs

Where to get infos?

Chat

Diesel

What is an ORM?

What is diesel capable of?

Lets code something

Conclusion

What did we do?

What did you hopefully learn!

Two small projects

ldap0r

  • LDAP password reset tool
  • ($\sim$ 300 SloC)
  • First release
  • Tests

filerly

  • File sharing a la NextCloud
  • Not ready yet, work in progress…

The End

#+LaTeX:∈cludegraphics[width = 0.3\textwidth]{img/goodbye.jpg}

\Huge Thanks for your attention!!1!

This is the end..