Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Einführung in Rust

Einführung in Rust

Rust ist eine moderne Programmiersprache, die Performance und Sicherheit verbindet. Sie ist systemnah und bietet leistungsstarke Abstraktionen, die stark an dynamische Sprachen wie Ruby oder Python erinnern. Rust bietet Speichersicherheit ohne Garbage Collector und macht die Low-Level-Programmierung einfacher und sicherer. Matthias wird einen einführenden Vortrag über Rust halten und in diesem Rahmen auch einige der schönsten Features vorstellen. Außerdem wird er auf Einsatzmöglichkeiten für WebAssembly, Cloud Computing und mehr eingehen.

Matthias Endler

January 24, 2020
Tweet

More Decks by Matthias Endler

Other Decks in Technology

Transcript

  1. What Is Rust Doing
    Behind the Curtains?

    View full-size slide

  2. Rust is a systems programming language that runs
    blazingly fast, prevents segfaults, and guarantees thread
    safety. It aims to bring modern language design and an
    advanced type system to systems programming. Rust
    does not use a garbage collector, using advanced static
    analysis to provide deterministic drops instead.

    View full-size slide

  3. Empowering everyone

    to build reliable and
    efficient software.

    View full-size slide

  4. Matthias Endler
    @matthiasendler
    - Düsseldorf, Germany
    - Backend Engineer at
    - Website performance team
    - Worked a lot with Python and PHP
    - Likes hot chocolate
    endler.dev mre

    View full-size slide

  5. hello-rust.show

    View full-size slide

  6. 5.90GiB/s
    1.90GiB/s
    GNU cat fastcat

    View full-size slide

  7. 3GiB/s
    850MiB/s
    GNU yes My yes

    View full-size slide

  8. Do What You Can't

    View full-size slide

  9. Rust Facts
    • Programming language
    • Funded by Mozilla
    • First version: 2010
    • Version 1.0: May 2015
    • Current stable version: 1.40

    View full-size slide

  10. Rust Facts
    • Memory safety
    • No undefined behavior
    • Fearless concurrency
    • High-level language concepts
    • Strong compiler checks
    • Easily embeddable into existing

    projects

    View full-size slide

  11. What I like about…
    Package manager, Community
    Syntax, Libraries, Async
    Tooling, Documentation, Concurrency
    Speed, no overhead
    PHP:
    Python:

    Golang:

    C:

    View full-size slide

  12. What I like about…
    Package manager, Community
    Syntax, Libraries, Async
    Tooling, Documentation, Concurrency
    Speed, no overhead

    Generics, Error handling
    Rust:

    View full-size slide

  13. Complexity vs speed
    PHP
    Python
    Golang
    Rust
    C
    Faster "Easier"

    View full-size slide

  14. https://cacm.acm.org/magazines/2017/10/221326-a-large-scale-study-of-programming-languages-and-code-quality-in-github/fulltext

    View full-size slide

  15. hellö
    wc wc.php
    5 6

    View full-size slide

  16. File icon created by Justiconnic from the Noun Project

    View full-size slide

  17. ... but there's more!
    • How to differentiate between end
    of file and error?
    • Parallel execution for multiple
    files?
    • What about very long lines?
    • Buffers for performance
    • Timeouts for slow reads?
    • SIMD?

    View full-size slide

  18. • Handles missing files
    • Handles read errors
    • Handles large files
    • UTF-8 support
    • Fast buffered reading
    • No memory leaks

    View full-size slide

  19. https://cacm.acm.org/magazines/2017/10/221326-a-large-scale-study-of-programming-languages-and-code-quality-in-github/fulltext

    View full-size slide

  20. Rust productivity

    View full-size slide

  21. Who’s using Rust anyway?
    Firefox
    Dropbox
    Visual Studio Code
    npm
    Facebook (kind of)
    Google (kind of)
    trivago
    rust-lang.org/production

    View full-size slide

  22. https://endler.dev/2019/tinysearch

    View full-size slide

  23. 0
    750
    1500
    2250
    3000
    Go C Rust
    How big is " Hello World " (in KB)?
    40k 1k

    View full-size slide

  24. " Serverless "

    View full-size slide

  25. Thanks!
    endler.dev/talks

    View full-size slide