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

Rust Tooling (October 2015)

Rust Tooling (October 2015)

What tools are available for Rust development?
This talk gives you an overview of ways to help you write better Rust code.

Matthias Endler

October 28, 2015
Tweet

More Decks by Matthias Endler

Other Decks in Programming

Transcript

  1. Tooling

    View Slide

  2. Matthias Endler
    - Backend Engineer at trivago
    - Deals with Website Performance
    - Worked a lot with Python and PHP
    - Played a bit with Golang
    - Not a Rust Programmer yet
    - Likes the ideas of Rust
    @matthiasendler

    View Slide

  3. What I like about…
    • PHP: Package manager, Community
    • Python: Syntax, Libraries
    • Golang: Tooling, Documentation
    • C: Speed, no overhead

    View Slide

  4. What I like about…
    • PHP: Package manager, Community
    • Python: Syntax, Libraries
    • Golang: Tooling, Documentation
    • C: Speed, no overhead
    RUST

    View Slide

  5. RUST: High level on bare metal

    View Slide

  6. Complexity vs Speed
    • PHP
    • Python
    • Golang
    • Rust
    • C
    Faster „Easier“

    View Slide

  7. Systems Programming
    Memory management
    Error handling
    Static Typing
    Compiling

    View Slide

  8. Systems Programming
    is hard!

    View Slide

  9. Fast feedback loops
    What we need:

    View Slide

  10. Fast feedback loops
    What we need:
    Awesome tooling
    How we get it:

    View Slide

  11. Fast feedback loops
    What we need:
    Awesome tooling
    How we get it:
    Well integrated
    All of them should be

    View Slide

  12. IDEs?

    View Slide

  13. Visual Studio for Rust

    View Slide

  14. IntelliJ with Rust support

    View Slide

  15. Atom with Rust packages

    View Slide

  16. My tool wishlist
    Unit testing
    Package manager
    Syntax highlighting
    Formatting
    Code completion
    Debugging
    Code linter
    Benchmarking
    Profiling
    Code coverage

    View Slide

  17. My tool wishlist
    Unit testing: builtin
    Package manager
    Syntax highlighting
    Formatting
    Code completion
    Debugging
    Code linter
    Benchmarking
    Profiling
    Code coverage

    View Slide

  18. https://doc.rust-lang.org/book/testing.html
    Unit testing

    View Slide

  19. My tool wishlist
    Unit testing: builtin
    Package manager: cargo
    Syntax highlighting
    Formatting
    Code completion
    Debugging
    Code linter
    Benchmarking
    Profiling
    Code coverage

    View Slide

  20. My tool wishlist
    Unit testing: builtin
    Package manager: cargo
    Syntax highlighting: atom-language-rust
    Formatting
    Code completion
    Debugging
    Code linter
    Benchmarking
    Profiling
    Code coverage

    View Slide

  21. My tool wishlist
    Unit testing: builtin
    Package manager: cargo
    Syntax highlighting: atom-language-rust
    Formatting: rustfmt
    Code completion
    Debugging
    Code linter
    Benchmarking
    Profiling
    Code coverage

    View Slide

  22. My tool wishlist
    Unit testing: builtin
    Package manager: cargo
    Syntax highlighting: atom-language-rust
    Formatting: rustfmt
    Code completion: racer
    Debugging
    Code linter
    Benchmarking
    Profiling
    Code coverage

    View Slide

  23. My tool wishlist
    Unit testing: builtin
    Package manager: cargo
    Syntax highlighting: atom-language-rust
    Formatting: rustfmt
    Code completion: racer
    Debugging: rust gdb?
    Code linter
    Benchmarking
    Profiling
    Code coverage

    View Slide

  24. My tool wishlist
    Unit testing: builtin
    Package manager: cargo
    Syntax highlighting: atom-language-rust
    Formatting: rustfmt
    Code completion: racer
    Debugging: rust gdb?
    Code linter: clippy
    Benchmarking
    Profiling
    Code coverage

    View Slide

  25. My tool wishlist
    Unit testing: builtin
    Package manager: cargo
    Syntax highlighting: atom-language-rust
    Formatting: rustfmt
    Code completion: racer
    Debugging: rust gdb?
    Code linter: clippy
    Benchmarking: builtin
    Profiling
    Code coverage

    View Slide

  26. My tool wishlist
    Unit testing: builtin
    Package manager: cargo
    Syntax highlighting: atom-language-rust
    Formatting: rustfmt
    Code completion: racer
    Debugging: rust gdb?
    Code linter: clippy
    Benchmarking: builtin
    Profiling: meh…
    Code coverage

    View Slide

  27. My tool wishlist
    Unit testing: builtin
    Package manager: cargo
    Syntax highlighting: atom-language-rust
    Formatting: rustfmt
    Code completion: racer
    Debugging: rust gdb?
    Code linter: clippy
    Benchmarking: builtin
    Profiling: meh… torch?
    Code coverage

    View Slide

  28. https://llogiq.github.io/2015/07/15/profiling.html
    Calls
    Time

    View Slide

  29. My tool wishlist
    Unit testing: builtin
    Package manager: cargo
    Syntax highlighting: atom-language-rust
    Formatting: rustfmt
    Code completion: racer
    Debugging: rust gdb?
    Code linter: clippy
    Benchmarking: builtin
    Profiling: meh… torch?
    Code coverage: kcov?

    View Slide

  30. kcov …is a code coverage tester for
    compiled programs, Python
    scripts and shell scripts
    language: rust
    matrix:
    fast_finish: true
    include:
    - rust: nightly
    env: FEATURES="--features nightly"
    sudo: false
    - rust: nightly
    env: FEATURES="--features nightly" BENCH=true
    sudo: false
    - rust: beta
    sudo: true
    after_success: |
    sudo apt-get install libcurl4-openssl-dev libelf-dev libdw-dev &&
    wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz &&
    tar xzf master.tar.gz && mkdir kcov-master/build && cd kcov-master/build && cmake .. && make &&
    sudo make install && cd ../.. &&
    kcov --coveralls-id=$TRAVIS_JOB_ID --exclude-pattern=/.cargo target/kcov target/debug/hyper-*
    Put this into your .travis.yml:

    View Slide

  31. Summary
    Lots of work to do
    But impressive start

    View Slide

  32. We need to focus on those…
    Unit testing
    Package manager
    Syntax highlighting
    Formatting
    Code completion
    Debugging
    Code linter
    Benchmarking
    Profiling
    Code coverage

    View Slide

  33. Bonus
    rr - a reverse debugger

    (http://rr-project.org/)
    Dash - Offline API Documentation browser for Mac
    (https://kapeli.com/dash)
    Crates.io reverse package lookup

    (https://crates.io/crates/serde/reverse_dependencies)

    View Slide

  34. Even more at
    https://gist.github.com/nrc/a3bbf6dd1b14ce57f18c

    View Slide