SlideShare uma empresa Scribd logo
1 de 60
How Rust
views tradeoffs
Steve Klabnik • 03.04.2019
InfoQ.com: News & Community Site
Watch the video with slide
synchronization on InfoQ.com!
https://www.infoq.com/presentations/
rust-tradeoffs/
• Over 1,000,000 software developers, architects and CTOs read the site world-
wide every month
• 250,000 senior developers subscribe to our weekly newsletter
• Published in 4 languages (English, Chinese, Japanese and Brazilian
Portuguese)
• Post content from our QCon conferences
• 2 dedicated podcast channels: The InfoQ Podcast, with a focus on
Architecture and The Engineering Culture Podcast, with a focus on building
• 96 deep dives on innovative topics packed as downloadable emags and
minibooks
• Over 40 new content items per week
Purpose of QCon
- to empower software development by facilitating the spread of
knowledge and innovation
Strategy
- practitioner-driven conference designed for YOU: influencers of
change and innovation in your teams
- speakers and topics driving the evolution and innovation
- connecting and catalyzing the influencers and innovators
Highlights
- attended by more than 12,000 delegates since 2007
- held in 9 cities worldwide
Presented at QCon London
www.qconlondon.com
Overview
What is a tradeoff?
“Bending the Curve”
Design is about values
Case Studies
● BDFL vs Design By Committee
● Stability Without Stagnation
● Acceptable levels of complexity
● Green vs System threads
Thanks, Bryan!
“Platform as a Reflection of Values”
Node Summit 2017
What is a tradeoff?
What is a tradeoff?
What is a tradeoff?
What is a tradeoff?
Space vs time
You can make it fast, or you can make it small
Throughput vs Latency
Two different measurements, often at odds
Dynamic Types vs Static Types
Ruby, or Haskell?
“Bending the curve”
Bending the Curve
One of these things is not like the others:
● Space vs Time
● Throughput vs Latency
● Dynamic Types vs Static Types
Bending the Curve
One of these things is not like the others:
● Space vs Time
● Throughput vs Latency
● Dynamic Types vs Static Types
Bending the Curve
A trade-off (or tradeoff) is a situational decision that involves
diminishing or losing one quality, quantity or property of a set
or design in return for gains in other aspects. In simple terms,
a tradeoff is where one thing increases and another must
decrease. -Wikipedia
Bending the Curve
Space vs time
Sometimes, smaller is faster
Dynamic Types vs Static Types
Gradual typing, anyone? (Don’t say “unityped”...)
Throughput vs Latency
Not inherently against each other, though they often are
Bending the Curve
This That
Bending the Curve
This That
Bending the Curve
This That
Bending the Curve
This That
Bending the Curve
This That
Bending the Curve
This That
Something else
Bending the Curve
A trade-off (or tradeoff) is a situational decision that involves
diminishing or losing one quality, quantity or property of a set
or design in return for gains in other aspects. In simple terms,
a tradeoff is where one thing increases and another must
decrease. -Wikipedia
Bending the Curve
In game theory and economic theory, a zero-sum game is a
mathematical representation of a situation in which each
participant's gain or loss of utility is exactly balanced by the
losses or gains of the utility of the other participants. If the
total gains of the participants are added up and the total
losses are subtracted, they will sum to zero. - Wikipedia
Bending the Curve
A win–win game is game theory which is designed in a way
that all participants can profit from the game in one way or
the other. In conflict resolution, a win–win strategy is a
collaborative strategy and conflict resolution process that
aims to accommodate all participants. - Wikipedia
Bending the Curve
When designing Rust, we ask ourselves:
Is this tradeoff fundamental, or through some
creativity, can we bend the curve into a
win-win situation?
The answer isn’t always yes, but it is yes surprisingly often.
Design is about Values
Design is about Values
What are your core values?
What things do you refuse to compromise on?
What are your secondary values?
What stuff would you like to have, but don’t need to have?
What do you not care about?
What things do others care about that you couldn’t care less for?
Design is about Values
Rust’s core values:
In a very particular order:
● Memory Safety
● Speed
● Productivity
Design is about Values
Rust’s secondary values:
● Ergonomics
● Compile times
● Correctness
Design is about Values
Rust doesn’t care about:
● Blazing a new trail in PLT
● Worse is Better
● Supporting certain kinds of old hardware
Design is about Values
Users have values too!
As a developer, you should do some introspection!
Use the tools that align with your values
Otherwise, you’re going to have a bad time
A mismatch causes problems
A lot of internet arguments are really about differing values
Design is about Values
So when you should use Rust?
Rust is ideal when you need a system that’s both reliable and
performant.
Sometimes, you don’t need those things! But sometimes, you do.
Sometimes, you don’t need those things at first, but then you do later.
We’ll leave the light on for you.
Case Study:
BDFL vs Design by Committee
BDFL vs Design by Committee
Benevolent Dictator For Life
Rules over projects with a velvet fist.
Design by Committee
“A camel is a horse designed by committee”
Can we do things differently?
BDFL vs Design by Committee
The Graydon years
Someone has to start this thing.
The Core Team years
More than one person should be in charge
The RFC Process + subteams
More than one team should be in charge
BDFL vs Design by Committee
This is a problem of scale
As things grow, you hit limits.
Only one team held us back
The Core Team was a bottleneck
New solutions come with new problems
More people and more distributed-ness means less cohesion
Case Study:
Stability Without Stagnation
Stability Without Stagnation
Stability
Things don’t change
Stagnation
Without change, growth is hard
Is this tradeoff fundamental?
We don’t believe so!
Stability Without Stagnation
https://blog.rust-lang.org/2014/10/30/Stability.html
Stability Without Stagnation
Stability
It's important to be clear about what we mean by stable. We don't
mean that Rust will stop evolving. We will release new versions of
Rust on a regular, frequent basis, and we hope that people will
upgrade just as regularly. But for that to happen, those upgrades need
to be painless.
To put it simply, our responsibility is to ensure that you never dread
upgrading Rust. If your code compiles on Rust stable 1.0, it should
compile with Rust stable 1.x with a minimum of hassle.
Stability Without Stagnation
The Plan
We will use a variation of the train model, first introduced in web browsers and
now widely used to provide stability without stagnation:
● New work lands directly in the master branch.
● Each day, the last successful build from master becomes the new nightly
release.
● Every six weeks, a beta branch is created from the current state of master,
and the previous beta is promoted to be the new stable release.
● In short, there are three release channels -- nightly, beta, and stable -- with
regular, frequent promotions from one channel to the next.
Stability Without Stagnation
The Plan
New features and new APIs will be flagged as unstable via feature gates and
stability attributes respectively. Unstable features and standard library APIs will
only be available on the nightly branch, and only if you explicitly "opt in" to the
instability.
The beta and stable releases, on the other hand, will only include features and APIs
deemed stable, which represents a commitment to avoid breaking code that uses
those features or APIs.
Stability Without Stagnation
This is a lot of work!
It’s worth it, though
We have a lot of bots to help
Without change, growth is hard
The tradeoff here is us vs users
We spend more time so our users don’t have to
Case Study:
Acceptable Levels of Complexity
Acceptable Complexity Level
Inherent complexity
Some kinds of complexity just exist
Incidental complexity
Some kinds of complexity are your fault
Different designs are differently complex
Fundamental choices can add or remove inherent complexity
Acceptable Complexity Level
Rust’s values mean large inherent complexity
7. It is easier to write an incorrect program than understand a correct
one.
8. A programming language is low level when its programs require
attention to the irrelevant.
23. To understand a program you must become both the machine and
the program.
Epigrams in Programming - Alan Perlis
Acceptable Complexity Level
Rust’s values mean large inherent complexity
Rust wants to help you write correct software. This means that a lot
of error handling gets exposed. It’s harder to handle more errors than
fewer errors, and it’s harder to handle Result<T, E> than ignore an
exception.
Things like the ? operator help reduce this, but it’s still present.
Acceptable Complexity Level
Rust’s values mean large inherent complexity
One way in which Rust provides safety and speed at the same time is
by using a strong static type system. Types are checked at compile
time, but free at runtime!
Strong static type systems have a lot of complexity.
Acceptable Complexity Level
Rust’s values mean large inherent complexity
Rust has a strong commitment to performance. This means that we
cannot rely on a garbage collector, and we have to expose, or at least
give access to, low-level details of the machine.
This inherently has more complexity than a language that doesn’t
prioritize these things.
Case Study:
Green vs System Threads
Green vs System threads
Two competing models
We won’t get too in the weeds here
System threads
An API offered by your operating system
Green threads
An API offered by your runtime; N system threads run M “green” ones
Green vs System threads
Two competing models
We won’t get too in the weeds here
System threads
An API offered by your operating system
Green threads
An API offered by your runtime; N system threads run M “green” ones
Green vs System threads
System Threads
● Requires calling into the
kernel
● Fixed stack size (8MB
default on x86_64 Linux)
Green Threads
● No system calls
● Much smaller stack size
(8kb default for a
goroutine)
Green vs System threads
Sometimes, values change over time
Rust was pre-1.0 for five years
Originally Rust had a runtime
This runtime provided green threads
Rust got lower-level over time
Were green threads still the right choice?
Green vs System threads
System Threads
● Shouldn’t a systems
language provide access to
the system API?
Green Threads
● Different stack means you
have to switch when calling
into C
● This creates overhead
unacceptable for a
performance-first systems
language
Green vs System threads
What about a unified API?
Could we bend the curve by having both?
libnative vs libgreen
Two implementations of one API; pick the one you want
The downsides of both and advantage of neither
Were green threads still the right choice?
Green vs System threads
Forced co-evolution. With today's design, the green and native threading models must
provide the same I/O API at all times. But there is functionality that is only appropriate or
efficient in one of the threading models.
Overhead. The current Rust model allows runtime mixtures of the green and native models.
Unfortunately, this flexibility has several downsides: Binary sizes, Task-local storage, Allocation
and dynamic dispatch.
Problematic I/O interactions. As the documentation for libgreen explains, only some I/O and
synchronization methods work seamlessly across native and green tasks.
Embedding Rust. When embedding Rust code into other contexts -- whether calling from C
code or embedding in high-level languages -- there is a fair amount of setup needed
Maintenance burden. Finally, libstd is made somewhat more complex by providing such a
flexible threading model
https://github.com/rust-lang/rfcs/blob/master/text/0230-remove-runtime.md
Green vs System threads
As values change, so do the answers
Neither side of a tradeoff is illegitimate
Take time to re-evaluate your values
Have your values changed since this decision was made?
In the end, this API was removed
Rust provides only system threads in its standard library
Green vs System threads
No runtime means bring your own!
Not everything has to be provided by the language
Need green threads? There are packages!
Rayon for CPU-bound tasks, Tokio for IO-bound tasks
There’s tradeoffs here too
Fragmentation is a real possibility; the community needs to pick a
winner and rally around it for this strategy to work well
Thanks! <3
1. Tradeoffs are inherent
2. Think outside the box
3. Rust shines when robustness
and speed are paramount
Watch the video with slide
synchronization on InfoQ.com!
https://www.infoq.com/presentations/
rust-tradeoffs/

Mais conteúdo relacionado

Mais procurados

Common Sense Software Development
Common Sense Software DevelopmentCommon Sense Software Development
Common Sense Software DevelopmentNitin Bhide
 
Agility via Software Engineering Practices - Agile Tour Montreal 2015
Agility via Software Engineering Practices - Agile Tour Montreal 2015Agility via Software Engineering Practices - Agile Tour Montreal 2015
Agility via Software Engineering Practices - Agile Tour Montreal 2015Steve Mercier
 
Scrum plus – why scrum is not enough for successful delivery
Scrum plus – why scrum is not enough for successful deliveryScrum plus – why scrum is not enough for successful delivery
Scrum plus – why scrum is not enough for successful deliveryNaveen Kumar Singh
 
Facilitation Foundations - A Guide to Effective Agile Meetings
Facilitation Foundations - A Guide to Effective Agile MeetingsFacilitation Foundations - A Guide to Effective Agile Meetings
Facilitation Foundations - A Guide to Effective Agile MeetingsAgileDad
 
Lecture 3 object-oriented design
Lecture 3    object-oriented designLecture 3    object-oriented design
Lecture 3 object-oriented designNada G.Youssef
 
Agile Estimating & Planning
Agile Estimating & PlanningAgile Estimating & Planning
Agile Estimating & PlanningAgileDad
 
Empowering Agile Teams
Empowering Agile TeamsEmpowering Agile Teams
Empowering Agile TeamsAgileDad
 
Leveraging Your Company's DevOps Transformation (AppSec USA 2014)
Leveraging Your Company's DevOps Transformation (AppSec USA 2014)Leveraging Your Company's DevOps Transformation (AppSec USA 2014)
Leveraging Your Company's DevOps Transformation (AppSec USA 2014)dev2ops
 
LKNL12: Kanban for the whole value stream
LKNL12: Kanban for the whole value streamLKNL12: Kanban for the whole value stream
LKNL12: Kanban for the whole value streamVasco Duarte
 
10 Big Ideas from Industry
10 Big Ideas from Industry10 Big Ideas from Industry
10 Big Ideas from IndustryGarth Gilmour
 
The Whole Team Approach, Illustrated. Keynote from Turku Agile Days 2012
The Whole Team Approach, Illustrated. Keynote from Turku Agile Days 2012The Whole Team Approach, Illustrated. Keynote from Turku Agile Days 2012
The Whole Team Approach, Illustrated. Keynote from Turku Agile Days 2012lisacrispin
 
Simple Measurements #2
Simple Measurements #2Simple Measurements #2
Simple Measurements #2Schalk Cronjé
 
Evolution of Software Engineering in NCTR Projects
Evolution of Software Engineering in NCTR  Projects   Evolution of Software Engineering in NCTR  Projects
Evolution of Software Engineering in NCTR Projects Mohammed Abbas
 
Prashant technical practices-tdd for xebia event
Prashant   technical practices-tdd for xebia eventPrashant   technical practices-tdd for xebia event
Prashant technical practices-tdd for xebia eventXebia India
 
Heart of DevOps - Ryan Lockard
Heart of DevOps - Ryan LockardHeart of DevOps - Ryan Lockard
Heart of DevOps - Ryan Lockardagilemaine
 
Technical Debt and Requirements
Technical Debt and RequirementsTechnical Debt and Requirements
Technical Debt and RequirementsNeil Ernst
 

Mais procurados (20)

Common Sense Software Development
Common Sense Software DevelopmentCommon Sense Software Development
Common Sense Software Development
 
Agility via Software Engineering Practices - Agile Tour Montreal 2015
Agility via Software Engineering Practices - Agile Tour Montreal 2015Agility via Software Engineering Practices - Agile Tour Montreal 2015
Agility via Software Engineering Practices - Agile Tour Montreal 2015
 
Scrum plus – why scrum is not enough for successful delivery
Scrum plus – why scrum is not enough for successful deliveryScrum plus – why scrum is not enough for successful delivery
Scrum plus – why scrum is not enough for successful delivery
 
Facilitation Foundations - A Guide to Effective Agile Meetings
Facilitation Foundations - A Guide to Effective Agile MeetingsFacilitation Foundations - A Guide to Effective Agile Meetings
Facilitation Foundations - A Guide to Effective Agile Meetings
 
Lecture 3 object-oriented design
Lecture 3    object-oriented designLecture 3    object-oriented design
Lecture 3 object-oriented design
 
Agile Estimating & Planning
Agile Estimating & PlanningAgile Estimating & Planning
Agile Estimating & Planning
 
Agile Testing
Agile Testing  Agile Testing
Agile Testing
 
Empowering Agile Teams
Empowering Agile TeamsEmpowering Agile Teams
Empowering Agile Teams
 
Leveraging Your Company's DevOps Transformation (AppSec USA 2014)
Leveraging Your Company's DevOps Transformation (AppSec USA 2014)Leveraging Your Company's DevOps Transformation (AppSec USA 2014)
Leveraging Your Company's DevOps Transformation (AppSec USA 2014)
 
LKNL12: Kanban for the whole value stream
LKNL12: Kanban for the whole value streamLKNL12: Kanban for the whole value stream
LKNL12: Kanban for the whole value stream
 
10 Big Ideas from Industry
10 Big Ideas from Industry10 Big Ideas from Industry
10 Big Ideas from Industry
 
Real World TDD
Real World TDDReal World TDD
Real World TDD
 
The Whole Team Approach, Illustrated. Keynote from Turku Agile Days 2012
The Whole Team Approach, Illustrated. Keynote from Turku Agile Days 2012The Whole Team Approach, Illustrated. Keynote from Turku Agile Days 2012
The Whole Team Approach, Illustrated. Keynote from Turku Agile Days 2012
 
Oredev pairing
Oredev pairingOredev pairing
Oredev pairing
 
Simple Measurements #2
Simple Measurements #2Simple Measurements #2
Simple Measurements #2
 
Evolution of Software Engineering in NCTR Projects
Evolution of Software Engineering in NCTR  Projects   Evolution of Software Engineering in NCTR  Projects
Evolution of Software Engineering in NCTR Projects
 
Prashant technical practices-tdd for xebia event
Prashant   technical practices-tdd for xebia eventPrashant   technical practices-tdd for xebia event
Prashant technical practices-tdd for xebia event
 
Simple measurements
Simple measurementsSimple measurements
Simple measurements
 
Heart of DevOps - Ryan Lockard
Heart of DevOps - Ryan LockardHeart of DevOps - Ryan Lockard
Heart of DevOps - Ryan Lockard
 
Technical Debt and Requirements
Technical Debt and RequirementsTechnical Debt and Requirements
Technical Debt and Requirements
 

Semelhante a How Rust Views Tradeoffs

Agile intro resources
Agile intro resourcesAgile intro resources
Agile intro resourcesAnwar Sadat
 
DevOps - Understanding Core Concepts
DevOps - Understanding Core ConceptsDevOps - Understanding Core Concepts
DevOps - Understanding Core ConceptsNitin Bhide
 
DevOps - Understanding Core Concepts (Old)
DevOps - Understanding Core Concepts (Old)DevOps - Understanding Core Concepts (Old)
DevOps - Understanding Core Concepts (Old)Nitin Bhide
 
Scrum e a Crise Mundial
Scrum e a Crise MundialScrum e a Crise Mundial
Scrum e a Crise MundialMarcos Garrido
 
2019 State of DevOps Report: Database Best Practices for Strong DevOps
2019 State of DevOps Report: Database Best Practices for Strong DevOps2019 State of DevOps Report: Database Best Practices for Strong DevOps
2019 State of DevOps Report: Database Best Practices for Strong DevOpsDevOps.com
 
The Latest in DevOps: Elite Performance, Productivity, and Scaling - Google
The Latest in DevOps: Elite Performance, Productivity, and Scaling - GoogleThe Latest in DevOps: Elite Performance, Productivity, and Scaling - Google
The Latest in DevOps: Elite Performance, Productivity, and Scaling - GoogleMarilyne Huret
 
WhoIsKenDeLong
WhoIsKenDeLongWhoIsKenDeLong
WhoIsKenDeLongKen DeLong
 
Data Engineer's Lunch #68: DevOps Fundamentals
Data Engineer's Lunch #68: DevOps FundamentalsData Engineer's Lunch #68: DevOps Fundamentals
Data Engineer's Lunch #68: DevOps FundamentalsAnant Corporation
 
Monktoberfest Fast Delivery
Monktoberfest Fast DeliveryMonktoberfest Fast Delivery
Monktoberfest Fast DeliveryAdrian Cockcroft
 
Real-Time Metrics and Distributed Monitoring - Jeff Pierce, Change.org - Dev...
Real-Time Metrics and Distributed Monitoring - Jeff Pierce, Change.org -  Dev...Real-Time Metrics and Distributed Monitoring - Jeff Pierce, Change.org -  Dev...
Real-Time Metrics and Distributed Monitoring - Jeff Pierce, Change.org - Dev...DevOpsDays Tel Aviv
 
Velocity. Agility. Python. (Pycon APAC 2017)
Velocity. Agility. Python. (Pycon APAC 2017)Velocity. Agility. Python. (Pycon APAC 2017)
Velocity. Agility. Python. (Pycon APAC 2017)Sian Lerk Lau
 
Using Bets, Boards and Missions to Inspire Org-wide Agility
Using Bets, Boards and Missions to Inspire Org-wide AgilityUsing Bets, Boards and Missions to Inspire Org-wide Agility
Using Bets, Boards and Missions to Inspire Org-wide AgilityC4Media
 
SAD07 - Project Management
SAD07 - Project ManagementSAD07 - Project Management
SAD07 - Project ManagementMichael Heron
 
Introduction to Agile Software Development Process
Introduction to Agile Software Development ProcessIntroduction to Agile Software Development Process
Introduction to Agile Software Development ProcessSoftware Park Thailand
 
Software Development Life Cycle
Software Development Life CycleSoftware Development Life Cycle
Software Development Life Cyclenayanbanik
 
Agile Software Architecture
Agile Software ArchitectureAgile Software Architecture
Agile Software ArchitectureChris F Carroll
 
Why Isn't Clean Coding Working For My Team
Why Isn't Clean Coding Working For My TeamWhy Isn't Clean Coding Working For My Team
Why Isn't Clean Coding Working For My TeamRob Curry
 
Develop, deploy, and operate services at reddit scale oscon 2018
Develop, deploy, and operate services at reddit scale   oscon 2018Develop, deploy, and operate services at reddit scale   oscon 2018
Develop, deploy, and operate services at reddit scale oscon 2018Gregory Taylor
 

Semelhante a How Rust Views Tradeoffs (20)

Introduction to Agile
Introduction to AgileIntroduction to Agile
Introduction to Agile
 
Agile intro resources
Agile intro resourcesAgile intro resources
Agile intro resources
 
DevOps - Understanding Core Concepts
DevOps - Understanding Core ConceptsDevOps - Understanding Core Concepts
DevOps - Understanding Core Concepts
 
DevOps - Understanding Core Concepts (Old)
DevOps - Understanding Core Concepts (Old)DevOps - Understanding Core Concepts (Old)
DevOps - Understanding Core Concepts (Old)
 
Scrum e a Crise Mundial
Scrum e a Crise MundialScrum e a Crise Mundial
Scrum e a Crise Mundial
 
2019 State of DevOps Report: Database Best Practices for Strong DevOps
2019 State of DevOps Report: Database Best Practices for Strong DevOps2019 State of DevOps Report: Database Best Practices for Strong DevOps
2019 State of DevOps Report: Database Best Practices for Strong DevOps
 
The Latest in DevOps: Elite Performance, Productivity, and Scaling - Google
The Latest in DevOps: Elite Performance, Productivity, and Scaling - GoogleThe Latest in DevOps: Elite Performance, Productivity, and Scaling - Google
The Latest in DevOps: Elite Performance, Productivity, and Scaling - Google
 
Reflections on SCM
Reflections on SCMReflections on SCM
Reflections on SCM
 
WhoIsKenDeLong
WhoIsKenDeLongWhoIsKenDeLong
WhoIsKenDeLong
 
Data Engineer's Lunch #68: DevOps Fundamentals
Data Engineer's Lunch #68: DevOps FundamentalsData Engineer's Lunch #68: DevOps Fundamentals
Data Engineer's Lunch #68: DevOps Fundamentals
 
Monktoberfest Fast Delivery
Monktoberfest Fast DeliveryMonktoberfest Fast Delivery
Monktoberfest Fast Delivery
 
Real-Time Metrics and Distributed Monitoring - Jeff Pierce, Change.org - Dev...
Real-Time Metrics and Distributed Monitoring - Jeff Pierce, Change.org -  Dev...Real-Time Metrics and Distributed Monitoring - Jeff Pierce, Change.org -  Dev...
Real-Time Metrics and Distributed Monitoring - Jeff Pierce, Change.org - Dev...
 
Velocity. Agility. Python. (Pycon APAC 2017)
Velocity. Agility. Python. (Pycon APAC 2017)Velocity. Agility. Python. (Pycon APAC 2017)
Velocity. Agility. Python. (Pycon APAC 2017)
 
Using Bets, Boards and Missions to Inspire Org-wide Agility
Using Bets, Boards and Missions to Inspire Org-wide AgilityUsing Bets, Boards and Missions to Inspire Org-wide Agility
Using Bets, Boards and Missions to Inspire Org-wide Agility
 
SAD07 - Project Management
SAD07 - Project ManagementSAD07 - Project Management
SAD07 - Project Management
 
Introduction to Agile Software Development Process
Introduction to Agile Software Development ProcessIntroduction to Agile Software Development Process
Introduction to Agile Software Development Process
 
Software Development Life Cycle
Software Development Life CycleSoftware Development Life Cycle
Software Development Life Cycle
 
Agile Software Architecture
Agile Software ArchitectureAgile Software Architecture
Agile Software Architecture
 
Why Isn't Clean Coding Working For My Team
Why Isn't Clean Coding Working For My TeamWhy Isn't Clean Coding Working For My Team
Why Isn't Clean Coding Working For My Team
 
Develop, deploy, and operate services at reddit scale oscon 2018
Develop, deploy, and operate services at reddit scale   oscon 2018Develop, deploy, and operate services at reddit scale   oscon 2018
Develop, deploy, and operate services at reddit scale oscon 2018
 

Mais de C4Media

Streaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoStreaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoC4Media
 
Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileC4Media
 
Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020C4Media
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsC4Media
 
Kafka Needs No Keeper
Kafka Needs No KeeperKafka Needs No Keeper
Kafka Needs No KeeperC4Media
 
High Performing Teams Act Like Owners
High Performing Teams Act Like OwnersHigh Performing Teams Act Like Owners
High Performing Teams Act Like OwnersC4Media
 
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaDoes Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaC4Media
 
Service Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideService Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideC4Media
 
Shifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDShifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDC4Media
 
CI/CD for Machine Learning
CI/CD for Machine LearningCI/CD for Machine Learning
CI/CD for Machine LearningC4Media
 
Fault Tolerance at Speed
Fault Tolerance at SpeedFault Tolerance at Speed
Fault Tolerance at SpeedC4Media
 
Architectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsArchitectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsC4Media
 
ML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsC4Media
 
Build Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerBuild Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerC4Media
 
User & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleUser & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleC4Media
 
Scaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeScaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeC4Media
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereC4Media
 
The Talk You've Been Await-ing For
The Talk You've Been Await-ing ForThe Talk You've Been Await-ing For
The Talk You've Been Await-ing ForC4Media
 
Future of Data Engineering
Future of Data EngineeringFuture of Data Engineering
Future of Data EngineeringC4Media
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreC4Media
 

Mais de C4Media (20)

Streaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoStreaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live Video
 
Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy Mobile
 
Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java Applications
 
Kafka Needs No Keeper
Kafka Needs No KeeperKafka Needs No Keeper
Kafka Needs No Keeper
 
High Performing Teams Act Like Owners
High Performing Teams Act Like OwnersHigh Performing Teams Act Like Owners
High Performing Teams Act Like Owners
 
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaDoes Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
 
Service Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideService Meshes- The Ultimate Guide
Service Meshes- The Ultimate Guide
 
Shifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDShifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CD
 
CI/CD for Machine Learning
CI/CD for Machine LearningCI/CD for Machine Learning
CI/CD for Machine Learning
 
Fault Tolerance at Speed
Fault Tolerance at SpeedFault Tolerance at Speed
Fault Tolerance at Speed
 
Architectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsArchitectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep Systems
 
ML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.js
 
Build Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerBuild Your Own WebAssembly Compiler
Build Your Own WebAssembly Compiler
 
User & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleUser & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix Scale
 
Scaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeScaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's Edge
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home Everywhere
 
The Talk You've Been Await-ing For
The Talk You've Been Await-ing ForThe Talk You've Been Await-ing For
The Talk You've Been Await-ing For
 
Future of Data Engineering
Future of Data EngineeringFuture of Data Engineering
Future of Data Engineering
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
 

Último

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Último (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

How Rust Views Tradeoffs

  • 1. How Rust views tradeoffs Steve Klabnik • 03.04.2019
  • 2. InfoQ.com: News & Community Site Watch the video with slide synchronization on InfoQ.com! https://www.infoq.com/presentations/ rust-tradeoffs/ • Over 1,000,000 software developers, architects and CTOs read the site world- wide every month • 250,000 senior developers subscribe to our weekly newsletter • Published in 4 languages (English, Chinese, Japanese and Brazilian Portuguese) • Post content from our QCon conferences • 2 dedicated podcast channels: The InfoQ Podcast, with a focus on Architecture and The Engineering Culture Podcast, with a focus on building • 96 deep dives on innovative topics packed as downloadable emags and minibooks • Over 40 new content items per week
  • 3. Purpose of QCon - to empower software development by facilitating the spread of knowledge and innovation Strategy - practitioner-driven conference designed for YOU: influencers of change and innovation in your teams - speakers and topics driving the evolution and innovation - connecting and catalyzing the influencers and innovators Highlights - attended by more than 12,000 delegates since 2007 - held in 9 cities worldwide Presented at QCon London www.qconlondon.com
  • 4. Overview What is a tradeoff? “Bending the Curve” Design is about values Case Studies ● BDFL vs Design By Committee ● Stability Without Stagnation ● Acceptable levels of complexity ● Green vs System threads
  • 5. Thanks, Bryan! “Platform as a Reflection of Values” Node Summit 2017
  • 6. What is a tradeoff?
  • 7. What is a tradeoff?
  • 8. What is a tradeoff?
  • 9. What is a tradeoff? Space vs time You can make it fast, or you can make it small Throughput vs Latency Two different measurements, often at odds Dynamic Types vs Static Types Ruby, or Haskell?
  • 11. Bending the Curve One of these things is not like the others: ● Space vs Time ● Throughput vs Latency ● Dynamic Types vs Static Types
  • 12. Bending the Curve One of these things is not like the others: ● Space vs Time ● Throughput vs Latency ● Dynamic Types vs Static Types
  • 13. Bending the Curve A trade-off (or tradeoff) is a situational decision that involves diminishing or losing one quality, quantity or property of a set or design in return for gains in other aspects. In simple terms, a tradeoff is where one thing increases and another must decrease. -Wikipedia
  • 14. Bending the Curve Space vs time Sometimes, smaller is faster Dynamic Types vs Static Types Gradual typing, anyone? (Don’t say “unityped”...) Throughput vs Latency Not inherently against each other, though they often are
  • 20. Bending the Curve This That Something else
  • 21. Bending the Curve A trade-off (or tradeoff) is a situational decision that involves diminishing or losing one quality, quantity or property of a set or design in return for gains in other aspects. In simple terms, a tradeoff is where one thing increases and another must decrease. -Wikipedia
  • 22. Bending the Curve In game theory and economic theory, a zero-sum game is a mathematical representation of a situation in which each participant's gain or loss of utility is exactly balanced by the losses or gains of the utility of the other participants. If the total gains of the participants are added up and the total losses are subtracted, they will sum to zero. - Wikipedia
  • 23. Bending the Curve A win–win game is game theory which is designed in a way that all participants can profit from the game in one way or the other. In conflict resolution, a win–win strategy is a collaborative strategy and conflict resolution process that aims to accommodate all participants. - Wikipedia
  • 24. Bending the Curve When designing Rust, we ask ourselves: Is this tradeoff fundamental, or through some creativity, can we bend the curve into a win-win situation? The answer isn’t always yes, but it is yes surprisingly often.
  • 25. Design is about Values
  • 26. Design is about Values What are your core values? What things do you refuse to compromise on? What are your secondary values? What stuff would you like to have, but don’t need to have? What do you not care about? What things do others care about that you couldn’t care less for?
  • 27. Design is about Values Rust’s core values: In a very particular order: ● Memory Safety ● Speed ● Productivity
  • 28. Design is about Values Rust’s secondary values: ● Ergonomics ● Compile times ● Correctness
  • 29. Design is about Values Rust doesn’t care about: ● Blazing a new trail in PLT ● Worse is Better ● Supporting certain kinds of old hardware
  • 30. Design is about Values Users have values too! As a developer, you should do some introspection! Use the tools that align with your values Otherwise, you’re going to have a bad time A mismatch causes problems A lot of internet arguments are really about differing values
  • 31. Design is about Values So when you should use Rust? Rust is ideal when you need a system that’s both reliable and performant. Sometimes, you don’t need those things! But sometimes, you do. Sometimes, you don’t need those things at first, but then you do later. We’ll leave the light on for you.
  • 32. Case Study: BDFL vs Design by Committee
  • 33. BDFL vs Design by Committee Benevolent Dictator For Life Rules over projects with a velvet fist. Design by Committee “A camel is a horse designed by committee” Can we do things differently?
  • 34. BDFL vs Design by Committee The Graydon years Someone has to start this thing. The Core Team years More than one person should be in charge The RFC Process + subteams More than one team should be in charge
  • 35. BDFL vs Design by Committee This is a problem of scale As things grow, you hit limits. Only one team held us back The Core Team was a bottleneck New solutions come with new problems More people and more distributed-ness means less cohesion
  • 37. Stability Without Stagnation Stability Things don’t change Stagnation Without change, growth is hard Is this tradeoff fundamental? We don’t believe so!
  • 39. Stability Without Stagnation Stability It's important to be clear about what we mean by stable. We don't mean that Rust will stop evolving. We will release new versions of Rust on a regular, frequent basis, and we hope that people will upgrade just as regularly. But for that to happen, those upgrades need to be painless. To put it simply, our responsibility is to ensure that you never dread upgrading Rust. If your code compiles on Rust stable 1.0, it should compile with Rust stable 1.x with a minimum of hassle.
  • 40. Stability Without Stagnation The Plan We will use a variation of the train model, first introduced in web browsers and now widely used to provide stability without stagnation: ● New work lands directly in the master branch. ● Each day, the last successful build from master becomes the new nightly release. ● Every six weeks, a beta branch is created from the current state of master, and the previous beta is promoted to be the new stable release. ● In short, there are three release channels -- nightly, beta, and stable -- with regular, frequent promotions from one channel to the next.
  • 41. Stability Without Stagnation The Plan New features and new APIs will be flagged as unstable via feature gates and stability attributes respectively. Unstable features and standard library APIs will only be available on the nightly branch, and only if you explicitly "opt in" to the instability. The beta and stable releases, on the other hand, will only include features and APIs deemed stable, which represents a commitment to avoid breaking code that uses those features or APIs.
  • 42. Stability Without Stagnation This is a lot of work! It’s worth it, though We have a lot of bots to help Without change, growth is hard The tradeoff here is us vs users We spend more time so our users don’t have to
  • 44. Acceptable Complexity Level Inherent complexity Some kinds of complexity just exist Incidental complexity Some kinds of complexity are your fault Different designs are differently complex Fundamental choices can add or remove inherent complexity
  • 45. Acceptable Complexity Level Rust’s values mean large inherent complexity 7. It is easier to write an incorrect program than understand a correct one. 8. A programming language is low level when its programs require attention to the irrelevant. 23. To understand a program you must become both the machine and the program. Epigrams in Programming - Alan Perlis
  • 46. Acceptable Complexity Level Rust’s values mean large inherent complexity Rust wants to help you write correct software. This means that a lot of error handling gets exposed. It’s harder to handle more errors than fewer errors, and it’s harder to handle Result<T, E> than ignore an exception. Things like the ? operator help reduce this, but it’s still present.
  • 47. Acceptable Complexity Level Rust’s values mean large inherent complexity One way in which Rust provides safety and speed at the same time is by using a strong static type system. Types are checked at compile time, but free at runtime! Strong static type systems have a lot of complexity.
  • 48. Acceptable Complexity Level Rust’s values mean large inherent complexity Rust has a strong commitment to performance. This means that we cannot rely on a garbage collector, and we have to expose, or at least give access to, low-level details of the machine. This inherently has more complexity than a language that doesn’t prioritize these things.
  • 49. Case Study: Green vs System Threads
  • 50. Green vs System threads Two competing models We won’t get too in the weeds here System threads An API offered by your operating system Green threads An API offered by your runtime; N system threads run M “green” ones
  • 51. Green vs System threads Two competing models We won’t get too in the weeds here System threads An API offered by your operating system Green threads An API offered by your runtime; N system threads run M “green” ones
  • 52. Green vs System threads System Threads ● Requires calling into the kernel ● Fixed stack size (8MB default on x86_64 Linux) Green Threads ● No system calls ● Much smaller stack size (8kb default for a goroutine)
  • 53. Green vs System threads Sometimes, values change over time Rust was pre-1.0 for five years Originally Rust had a runtime This runtime provided green threads Rust got lower-level over time Were green threads still the right choice?
  • 54. Green vs System threads System Threads ● Shouldn’t a systems language provide access to the system API? Green Threads ● Different stack means you have to switch when calling into C ● This creates overhead unacceptable for a performance-first systems language
  • 55. Green vs System threads What about a unified API? Could we bend the curve by having both? libnative vs libgreen Two implementations of one API; pick the one you want The downsides of both and advantage of neither Were green threads still the right choice?
  • 56. Green vs System threads Forced co-evolution. With today's design, the green and native threading models must provide the same I/O API at all times. But there is functionality that is only appropriate or efficient in one of the threading models. Overhead. The current Rust model allows runtime mixtures of the green and native models. Unfortunately, this flexibility has several downsides: Binary sizes, Task-local storage, Allocation and dynamic dispatch. Problematic I/O interactions. As the documentation for libgreen explains, only some I/O and synchronization methods work seamlessly across native and green tasks. Embedding Rust. When embedding Rust code into other contexts -- whether calling from C code or embedding in high-level languages -- there is a fair amount of setup needed Maintenance burden. Finally, libstd is made somewhat more complex by providing such a flexible threading model https://github.com/rust-lang/rfcs/blob/master/text/0230-remove-runtime.md
  • 57. Green vs System threads As values change, so do the answers Neither side of a tradeoff is illegitimate Take time to re-evaluate your values Have your values changed since this decision was made? In the end, this API was removed Rust provides only system threads in its standard library
  • 58. Green vs System threads No runtime means bring your own! Not everything has to be provided by the language Need green threads? There are packages! Rayon for CPU-bound tasks, Tokio for IO-bound tasks There’s tradeoffs here too Fragmentation is a real possibility; the community needs to pick a winner and rally around it for this strategy to work well
  • 59. Thanks! <3 1. Tradeoffs are inherent 2. Think outside the box 3. Rust shines when robustness and speed are paramount
  • 60. Watch the video with slide synchronization on InfoQ.com! https://www.infoq.com/presentations/ rust-tradeoffs/