Behind the scenes of Rust Alex Crichton Tooling Infrastructure - - PowerPoint PPT Presentation

behind the scenes of rust
SMART_READER_LITE
LIVE PREVIEW

Behind the scenes of Rust Alex Crichton Tooling Infrastructure - - PowerPoint PPT Presentation

Behind the scenes of Rust Alex Crichton Tooling Infrastructure Community Were not in 1970 Developers have high expectations for tooling support Developers also expect a lot of tools Tools alone can often spawn entire ecosystems


slide-1
SLIDE 1

Behind the scenes of Rust

Alex Crichton

slide-2
SLIDE 2
slide-3
SLIDE 3
slide-4
SLIDE 4
slide-5
SLIDE 5
slide-6
SLIDE 6
slide-7
SLIDE 7
slide-8
SLIDE 8

Tooling Infrastructure Community

slide-9
SLIDE 9

We’re not in 1970

  • Developers have high expectations for tooling support
  • Developers also expect a lot of tools
  • Tools alone can often spawn entire ecosystems
slide-10
SLIDE 10

Tools in Rust

  • cargo
  • rustdoc
  • rustup
  • rustc
  • gdb
  • RLS
  • rustfmt
slide-11
SLIDE 11

Why Cargo?

Time Crates

slide-12
SLIDE 12

Why Cargo?

  • Sharing code is critical for a young language
  • A package manager from day one is hugely beneficial
  • Despite blocking 1.0 on Cargo, Cargo accelerated

stabilization of libstd through aggressive pruning

slide-13
SLIDE 13

How has Cargo helped?

  • Small standard library far easier to port and maintain
  • “Dependency hell” is almost a thing of the past
  • Language features like custom derive far easier with

Cargo

slide-14
SLIDE 14

What else was missing?

slide-15
SLIDE 15

Enter the LSP

slide-16
SLIDE 16

Enter the RLS

slide-17
SLIDE 17

RLS requirements

  • Needs to support common IDE queries like
  • go to definition
  • find all uses
  • renaming variables
  • Can’t reimplement all of rustc
  • Responses must be fast

“You must use rustc” “You must not use rustc”

slide-18
SLIDE 18

Getting rustc fast

slide-19
SLIDE 19

Getting rustc fast

Where’s the definition of this type?

slide-20
SLIDE 20

Polishing the RLS

rustup component add rls-preview

slide-21
SLIDE 21

Tools in Rust

  • cargo
  • rustdoc
  • rustup
  • rustc
  • gdb
  • RLS
  • rustfmt
slide-22
SLIDE 22

Tooling Infrastructure Community

slide-23
SLIDE 23

We’re still not in 1970

  • Developers expect their tools to not break
  • Developers expect low friction when managing tools
  • Vast majority of users will always be new ones
slide-24
SLIDE 24

Infrastructure of Rust

  • Continuous Integration
  • {www,doc,play}.rust-lang.org
  • crates.io
  • Rapid release cycle
  • “Dealing with GitHub”
  • AWS services, CDNs, storage, etc
slide-25
SLIDE 25
  • Managed via PRs on GitHub
  • Continuously deployed
  • Delivered via CloudFront CDN
  • Fun with DNS/SSL/…
slide-26
SLIDE 26
slide-27
SLIDE 27
slide-28
SLIDE 28

rustup update

  • Also delivered via CDN
  • Delivers over 50 targets to compile to
  • Crazy platform-specific logic in rustup itself
slide-29
SLIDE 29

cargo build

  • crates.io crates delivered via CDN
  • crates.io itself written in Rust
  • Deployed via Heroku
slide-30
SLIDE 30

You’ve found a bug!

  • All rustc/Rust language development happens on GitHub
  • GitHub is what most know and love, makes it easiest for

new contributors

  • Let’s send a PR…
slide-31
SLIDE 31
slide-32
SLIDE 32
slide-33
SLIDE 33

bors: Mandatory homage

slide-34
SLIDE 34

The Last of the Masters

The title character, Bors, a 200-year-old "government integration robot"—and the last in existence—awakens after a routine maintenance check to learn that his motor system is in a state of decline. An artificially intelligent machine who displays a degree of emotion and even psychological complexity, he is informed by Fowler, a personal mechanic, that his body has begun to break down due to age.

slide-35
SLIDE 35

bors never sleeps

slide-36
SLIDE 36

bors in action

slide-37
SLIDE 37

bors in action

slide-38
SLIDE 38

bors in action

slide-39
SLIDE 39

bors in action

slide-40
SLIDE 40
slide-41
SLIDE 41
slide-42
SLIDE 42

Release trains

  • Nightly, beta, stable channels
  • Automatic nightlies each night
  • Stable/beta updated once every 6 weeks
  • Stable/beta receive bug fixes with “backports”
slide-43
SLIDE 43

Infrastructure of Rust

  • Continuous Integration
  • {www,doc,play}.rust-lang.org
  • crates.io
  • Rapid release cycle
  • “Dealing with GitHub”
  • AWS services, CDNs, storage, etc
slide-44
SLIDE 44

Tooling Infrastructure Community

slide-45
SLIDE 45

We get it, it’s not 1970

  • Development does not happen in isolation any more
  • Everyone’s got thoughts (often great ones!)
  • Early stage projects live and die by their communities
slide-46
SLIDE 46

Rust’s Community

  • Governance of Rust itself
  • RFC process
  • Internals/users forum, IRC
  • Community team
  • Conferences
slide-47
SLIDE 47
slide-48
SLIDE 48

To int or not to int?

slide-49
SLIDE 49

Reducing entropy

slide-50
SLIDE 50
slide-51
SLIDE 51
slide-52
SLIDE 52