Should you rewrite in Rust? -...

185
Should you rewrite in Rust? @qedunham Intro Should you rewrite? Categorizing Rewrites Communicating about Code Changes Rewriting to understand Case studies: Rewriting to understand Rewriting to deploy What’s the smallest change that would solve your problem? Can Rust solve your problem? Case study: NPM Case study: Project Quantum Rewriting vs green field Rewriting techniques FFI from Your Language Static Linking Rust Optional Tools Q&A Should you rewrite in Rust? talks.edunham.net/lca2018/rust @qedunham LinuxConf Australia January 23, 2018 http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Transcript of Should you rewrite in Rust? -...

Page 1: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Should you rewrite in Rust?talks.edunham.net/lca2018/rust

@qedunham

LinuxConf Australia

January 23, 2018

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 2: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Pop Quiz

I Do you know what I’m here to tell you?

I ”Rewrite your code!”

I ”Don’t rewrite your code!”

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 3: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Pop Quiz

I Do you know what I’m here to tell you?

I ”Rewrite your code!”

I ”Don’t rewrite your code!”

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 4: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Pop Quiz

I Do you know what I’m here to tell you?

I ”Rewrite your code!”

I ”Don’t rewrite your code!”

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 5: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Pop Quiz

I Do you know what I’m here to tell you?

I ”Rewrite your code!”

I ”Don’t rewrite your code!”

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 6: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

About Me

I DevOps at Mozilla Research

I Rust, Servo, VR

I Rust Community Team

I Opinions mine, formed through research

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 7: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

About Me

I DevOps at Mozilla Research

I Rust, Servo, VR

I Rust Community Team

I Opinions mine, formed through research

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 8: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

About Me

I DevOps at Mozilla Research

I Rust, Servo, VR

I Rust Community Team

I Opinions mine, formed through research

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 9: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

About Me

I DevOps at Mozilla Research

I Rust, Servo, VR

I Rust Community Team

I Opinions mine, formed through research

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 10: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

About Me

I DevOps at Mozilla Research

I Rust, Servo, VR

I Rust Community Team

I Opinions mine, formed through research

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 11: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

OutlineIntro

Should you rewrite?Categorizing RewritesCommunicating about Code ChangesRewriting to understandCase studies: Rewriting to understand

Rewriting to deployWhat’s the smallest change that would solve yourproblem?Can Rust solve your problem?Case study: NPMCase study: Project QuantumRewriting vs green field

Rewriting techniquesFFI from Your LanguageStatic Linking RustOptional Tools

Q & A

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 12: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

OutlineIntroShould you rewrite?

Categorizing RewritesCommunicating about Code ChangesRewriting to understandCase studies: Rewriting to understand

Rewriting to deployWhat’s the smallest change that would solve yourproblem?Can Rust solve your problem?Case study: NPMCase study: Project QuantumRewriting vs green field

Rewriting techniquesFFI from Your LanguageStatic Linking RustOptional Tools

Q & A

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 13: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

OutlineIntroShould you rewrite?

Categorizing RewritesCommunicating about Code ChangesRewriting to understandCase studies: Rewriting to understand

Rewriting to deployWhat’s the smallest change that would solve yourproblem?Can Rust solve your problem?Case study: NPMCase study: Project QuantumRewriting vs green field

Rewriting techniquesFFI from Your LanguageStatic Linking RustOptional Tools

Q & A

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 14: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

OutlineIntroShould you rewrite?

Categorizing RewritesCommunicating about Code ChangesRewriting to understandCase studies: Rewriting to understand

Rewriting to deployWhat’s the smallest change that would solve yourproblem?Can Rust solve your problem?Case study: NPMCase study: Project QuantumRewriting vs green field

Rewriting techniquesFFI from Your LanguageStatic Linking RustOptional Tools

Q & A

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 15: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

OutlineIntroShould you rewrite?

Categorizing RewritesCommunicating about Code ChangesRewriting to understandCase studies: Rewriting to understand

Rewriting to deployWhat’s the smallest change that would solve yourproblem?Can Rust solve your problem?Case study: NPMCase study: Project QuantumRewriting vs green field

Rewriting techniquesFFI from Your LanguageStatic Linking RustOptional Tools

Q & Ahttp://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 16: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Intro

Should you rewrite?Categorizing RewritesCommunicating about Code ChangesRewriting to understandCase studies: Rewriting to understand

Rewriting to deployWhat’s the smallest change that would solve yourproblem?Can Rust solve your problem?Case study: NPMCase study: Project QuantumRewriting vs green field

Rewriting techniquesFFI from Your LanguageStatic Linking RustOptional Tools

Q & A

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 17: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

I assume

I You’re working on some code.

I People help you with the code.

I People help the project in non-code ways.

I People use the code.

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 18: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

I assume

I You’re working on some code.

I People help you with the code.

I People help the project in non-code ways.

I People use the code.

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 19: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

I assume

I You’re working on some code.

I People help you with the code.

I People help the project in non-code ways.

I People use the code.

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 20: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

I assume

I You’re working on some code.

I People help you with the code.

I People help the project in non-code ways.

I People use the code.

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 21: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

I assume

I You’re working on some code.

I People help you with the code.

I People help the project in non-code ways.

I People use the code.

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 22: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Peoples’ time and happiness are valuable.

I You

I Colleagues

I Users

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 23: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Peoples’ time and happiness are valuable.

I You

I Colleagues

I Users

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 24: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Peoples’ time and happiness are valuable.

I You

I Colleagues

I Users

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 25: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Peoples’ time and happiness are valuable.

I You

I Colleagues

I Users

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 26: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Intro

Should you rewrite?Categorizing RewritesCommunicating about Code ChangesRewriting to understandCase studies: Rewriting to understand

Rewriting to deployWhat’s the smallest change that would solve yourproblem?Can Rust solve your problem?Case study: NPMCase study: Project QuantumRewriting vs green field

Rewriting techniquesFFI from Your LanguageStatic Linking RustOptional Tools

Q & A

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 27: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

What’s a rewrite?

Rewriting is starting anew on a problem that you alreadyhave code to address.Refactoring is modifying code which tries to solve aproblem.

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 28: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Sort rewrites by size

Smaller LargerConstrained Green-fieldFew new bugs YOLOQuick Slow

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 29: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Sort rewrites by motive

I Learn a tool

I Understand a task

I Ship production code

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 30: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Sort rewrites by motive

I Learn a tool

I Understand a task

I Ship production code

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 31: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Sort rewrites by motive

I Learn a tool

I Understand a task

I Ship production code

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 32: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Sort rewrites by motive

I Learn a tool

I Understand a task

I Ship production code

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 33: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rewriting to Understand

Costs your time:

I Researching

I Writing

I Debugging

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 34: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rewriting to Understand

Costs your time:

I Researching

I Writing

I Debugging

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 35: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rewriting to Understand

Costs your time:

I Researching

I Writing

I Debugging

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 36: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rewriting to Understand

Costs your time:

I Researching

I Writing

I Debugging

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 37: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rewriting to deploy

Costs everyone’s time:

I Researching

I Writing

I Debugging

I Explaining

I Ensuring backwards compatibility

I Tooling and automation

I Fixing new bugs

I Learning new system

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 38: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rewriting to deploy

Costs everyone’s time:

I Researching

I Writing

I Debugging

I Explaining

I Ensuring backwards compatibility

I Tooling and automation

I Fixing new bugs

I Learning new system

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 39: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rewriting to deploy

Costs everyone’s time:

I Researching

I Writing

I Debugging

I Explaining

I Ensuring backwards compatibility

I Tooling and automation

I Fixing new bugs

I Learning new system

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 40: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rewriting to deploy

Costs everyone’s time:

I Researching

I Writing

I Debugging

I Explaining

I Ensuring backwards compatibility

I Tooling and automation

I Fixing new bugs

I Learning new system

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 41: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rewriting to deploy

Costs everyone’s time:

I Researching

I Writing

I Debugging

I Explaining

I Ensuring backwards compatibility

I Tooling and automation

I Fixing new bugs

I Learning new system

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 42: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rewriting to deploy

Costs everyone’s time:

I Researching

I Writing

I Debugging

I Explaining

I Ensuring backwards compatibility

I Tooling and automation

I Fixing new bugs

I Learning new system

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 43: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rewriting to deploy

Costs everyone’s time:

I Researching

I Writing

I Debugging

I Explaining

I Ensuring backwards compatibility

I Tooling and automation

I Fixing new bugs

I Learning new system

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 44: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rewriting to deploy

Costs everyone’s time:

I Researching

I Writing

I Debugging

I Explaining

I Ensuring backwards compatibility

I Tooling and automation

I Fixing new bugs

I Learning new system

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 45: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rewriting to deploy

Costs everyone’s time:

I Researching

I Writing

I Debugging

I Explaining

I Ensuring backwards compatibility

I Tooling and automation

I Fixing new bugs

I Learning new system

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 46: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Why deploy a rewrite?

I Improve performance

I Improve maintainability

I Increase contributor base

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 47: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Why deploy a rewrite?

I Improve performance

I Improve maintainability

I Increase contributor base

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 48: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Why deploy a rewrite?

I Improve performance

I Improve maintainability

I Increase contributor base

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 49: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Why deploy a rewrite?

I Improve performance

I Improve maintainability

I Increase contributor base

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 50: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Intro

Should you rewrite?Categorizing RewritesCommunicating about Code ChangesRewriting to understandCase studies: Rewriting to understand

Rewriting to deployWhat’s the smallest change that would solve yourproblem?Can Rust solve your problem?Case study: NPMCase study: Project QuantumRewriting vs green field

Rewriting techniquesFFI from Your LanguageStatic Linking RustOptional Tools

Q & A

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 51: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Identify the problem

I What does the code do?

I What should it do?

I What if I don’t change it?

I How would I know if the problem was solved?

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 52: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Identify the problem

I What does the code do?

I What should it do?

I What if I don’t change it?

I How would I know if the problem was solved?

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 53: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Identify the problem

I What does the code do?

I What should it do?

I What if I don’t change it?

I How would I know if the problem was solved?

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 54: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Identify the problem

I What does the code do?

I What should it do?

I What if I don’t change it?

I How would I know if the problem was solved?

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 55: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Identify the problem

I What does the code do?

I What should it do?

I What if I don’t change it?

I How would I know if the problem was solved?

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 56: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Where’s the problem?

I Your definitions of what the system does and should do?

I Architecture and problem definition?

I Tooling, libraries, dependencies?

I Code’s logic?

I Code’s unintended side effects?

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 57: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Where’s the problem?

I Your definitions of what the system does and should do?

I Architecture and problem definition?

I Tooling, libraries, dependencies?

I Code’s logic?

I Code’s unintended side effects?

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 58: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Where’s the problem?

I Your definitions of what the system does and should do?

I Architecture and problem definition?

I Tooling, libraries, dependencies?

I Code’s logic?

I Code’s unintended side effects?

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 59: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Where’s the problem?

I Your definitions of what the system does and should do?

I Architecture and problem definition?

I Tooling, libraries, dependencies?

I Code’s logic?

I Code’s unintended side effects?

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 60: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Where’s the problem?

I Your definitions of what the system does and should do?

I Architecture and problem definition?

I Tooling, libraries, dependencies?

I Code’s logic?

I Code’s unintended side effects?

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 61: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Where’s the problem?

I Your definitions of what the system does and should do?

I Architecture and problem definition?

I Tooling, libraries, dependencies?

I Code’s logic?

I Code’s unintended side effects?

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 62: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Who will the change affect?

I You

I Other coders

I Documentation writers

I Marketers

I Users

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 63: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Who will the change affect?

I You

I Other coders

I Documentation writers

I Marketers

I Users

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 64: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Who will the change affect?

I You

I Other coders

I Documentation writers

I Marketers

I Users

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 65: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Who will the change affect?

I You

I Other coders

I Documentation writers

I Marketers

I Users

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 66: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Who will the change affect?

I You

I Other coders

I Documentation writers

I Marketers

I Users

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 67: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Who will the change affect?

I You

I Other coders

I Documentation writers

I Marketers

I Users

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 68: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Learn from history.

I Ask people about the proposed solution!

I Research others’ attempts here!

I Research other projects’ attempts!

I Can you get buy-in? Why or why not?

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 69: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Learn from history.

I Ask people about the proposed solution!

I Research others’ attempts here!

I Research other projects’ attempts!

I Can you get buy-in? Why or why not?

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 70: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Learn from history.

I Ask people about the proposed solution!

I Research others’ attempts here!

I Research other projects’ attempts!

I Can you get buy-in? Why or why not?

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 71: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Learn from history.

I Ask people about the proposed solution!

I Research others’ attempts here!

I Research other projects’ attempts!

I Can you get buy-in? Why or why not?

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 72: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Learn from history.

I Ask people about the proposed solution!

I Research others’ attempts here!

I Research other projects’ attempts!

I Can you get buy-in? Why or why not?

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 73: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Experts prefer small changes.

I Break big changes into small ones

I Lowest-cost solution for desired impact

I Minimize wasted effort

I Avoid consequences of needless complexity

I Risks compound.

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 74: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Experts prefer small changes.

I Break big changes into small ones

I Lowest-cost solution for desired impact

I Minimize wasted effort

I Avoid consequences of needless complexity

I Risks compound.

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 75: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Experts prefer small changes.

I Break big changes into small ones

I Lowest-cost solution for desired impact

I Minimize wasted effort

I Avoid consequences of needless complexity

I Risks compound.

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 76: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Experts prefer small changes.

I Break big changes into small ones

I Lowest-cost solution for desired impact

I Minimize wasted effort

I Avoid consequences of needless complexity

I Risks compound.

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 77: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Experts prefer small changes.

I Break big changes into small ones

I Lowest-cost solution for desired impact

I Minimize wasted effort

I Avoid consequences of needless complexity

I Risks compound.

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 78: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Experts prefer small changes.

I Break big changes into small ones

I Lowest-cost solution for desired impact

I Minimize wasted effort

I Avoid consequences of needless complexity

I Risks compound.

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 79: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

“You should go rewrite your code!”

What are you saying?

I “You should throw out your hard work!”

I “Your work would be easy to replace!”

I “You don’t understand your own engineering tradeoffs!”

I “I don’t understand the problem you’re trying to solve!”

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 80: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

“You should go rewrite your code!”

What are you saying?

I “You should throw out your hard work!”

I “Your work would be easy to replace!”

I “You don’t understand your own engineering tradeoffs!”

I “I don’t understand the problem you’re trying to solve!”

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 81: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

“You should go rewrite your code!”

What are you saying?

I “You should throw out your hard work!”

I “Your work would be easy to replace!”

I “You don’t understand your own engineering tradeoffs!”

I “I don’t understand the problem you’re trying to solve!”

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 82: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

“You should go rewrite your code!”

What are you saying?

I “You should throw out your hard work!”

I “Your work would be easy to replace!”

I “You don’t understand your own engineering tradeoffs!”

I “I don’t understand the problem you’re trying to solve!”

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 83: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

“You should go rewrite your code!”

What are you saying?

I “You should throw out your hard work!”

I “Your work would be easy to replace!”

I “You don’t understand your own engineering tradeoffs!”

I “I don’t understand the problem you’re trying to solve!”

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 84: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

How not to troll

I “I notice you’re getting a lot of issue reports about... ”

I “Your code has been tested by a lot of users!”

I “Would you like a patch which....?”

I “Where can I learn about other times you’ve tried tosolve this?”

I Why write code a project doesn’t want?

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 85: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

How not to troll

I “I notice you’re getting a lot of issue reports about... ”

I “Your code has been tested by a lot of users!”

I “Would you like a patch which....?”

I “Where can I learn about other times you’ve tried tosolve this?”

I Why write code a project doesn’t want?

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 86: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

How not to troll

I “I notice you’re getting a lot of issue reports about... ”

I “Your code has been tested by a lot of users!”

I “Would you like a patch which....?”

I “Where can I learn about other times you’ve tried tosolve this?”

I Why write code a project doesn’t want?

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 87: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

How not to troll

I “I notice you’re getting a lot of issue reports about... ”

I “Your code has been tested by a lot of users!”

I “Would you like a patch which....?”

I “Where can I learn about other times you’ve tried tosolve this?”

I Why write code a project doesn’t want?

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 88: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

How not to troll

I “I notice you’re getting a lot of issue reports about... ”

I “Your code has been tested by a lot of users!”

I “Would you like a patch which....?”

I “Where can I learn about other times you’ve tried tosolve this?”

I Why write code a project doesn’t want?

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 89: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

How not to troll

I “I notice you’re getting a lot of issue reports about... ”

I “Your code has been tested by a lot of users!”

I “Would you like a patch which....?”

I “Where can I learn about other times you’ve tried tosolve this?”

I Why write code a project doesn’t want?

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 90: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Intro

Should you rewrite?Categorizing RewritesCommunicating about Code ChangesRewriting to understandCase studies: Rewriting to understand

Rewriting to deployWhat’s the smallest change that would solve yourproblem?Can Rust solve your problem?Case study: NPMCase study: Project QuantumRewriting vs green field

Rewriting techniquesFFI from Your LanguageStatic Linking RustOptional Tools

Q & A

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 91: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Case studies: Rewriting to understand

I Use a familiar task or tool

I Document what you learn

I Take lessons home

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 92: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Case studies: Rewriting to understand

I Use a familiar task or tool

I Document what you learn

I Take lessons home

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 93: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Case studies: Rewriting to understand

I Use a familiar task or tool

I Document what you learn

I Take lessons home

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 94: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Case studies: Rewriting to understand

I Use a familiar task or tool

I Document what you learn

I Take lessons home

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 95: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Case studies: Rewriting to understand

“I know Rust and I wonder if it could make Zopflicompression faster”github.com/carols10cents/rust-out-your-c-talk

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 96: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Case studies: Rewriting to understand

“I have some familiar problems and I’d like to practice Rust”github.com/BartMassey/advent-of-code-2016

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 97: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Intro

Should you rewrite?Categorizing RewritesCommunicating about Code ChangesRewriting to understandCase studies: Rewriting to understand

Rewriting to deployWhat’s the smallest change that would solve yourproblem?Can Rust solve your problem?Case study: NPMCase study: Project QuantumRewriting vs green field

Rewriting techniquesFFI from Your LanguageStatic Linking RustOptional Tools

Q & A

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 98: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Intro

Should you rewrite?Categorizing RewritesCommunicating about Code ChangesRewriting to understandCase studies: Rewriting to understand

Rewriting to deployWhat’s the smallest change that would solve yourproblem?Can Rust solve your problem?Case study: NPMCase study: Project QuantumRewriting vs green field

Rewriting techniquesFFI from Your LanguageStatic Linking RustOptional Tools

Q & A

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 99: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Can your current language solve the problem?

I You already know it

I Minimal new dependencies

I Rewrite to understand, then apply lessons

I Extant code describes the problem

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 100: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Can your current language solve the problem?

I You already know it

I Minimal new dependencies

I Rewrite to understand, then apply lessons

I Extant code describes the problem

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 101: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Can your current language solve the problem?

I You already know it

I Minimal new dependencies

I Rewrite to understand, then apply lessons

I Extant code describes the problem

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 102: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Can your current language solve the problem?

I You already know it

I Minimal new dependencies

I Rewrite to understand, then apply lessons

I Extant code describes the problem

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 103: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Can your current language solve the problem?

I You already know it

I Minimal new dependencies

I Rewrite to understand, then apply lessons

I Extant code describes the problem

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 104: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Would a refactor suffice?

It’s slow...

I Refactor hot code

I Find a faster implementation

It’s confusing...

I Fix your docs

I Prune dead code

I Simplify and refactor

I Build and document boundary where you would addcode

People are bored...

I Recognize contributions publicly

I Communicate costs of ill-concieved changes

I Gamify issue fixing

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 105: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Would a refactor suffice?

It’s slow...

I Refactor hot code

I Find a faster implementation

It’s confusing...

I Fix your docs

I Prune dead code

I Simplify and refactor

I Build and document boundary where you would addcode

People are bored...

I Recognize contributions publicly

I Communicate costs of ill-concieved changes

I Gamify issue fixing

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 106: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Would a refactor suffice?

It’s slow...

I Refactor hot code

I Find a faster implementation

It’s confusing...

I Fix your docs

I Prune dead code

I Simplify and refactor

I Build and document boundary where you would addcode

People are bored...

I Recognize contributions publicly

I Communicate costs of ill-concieved changes

I Gamify issue fixing

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 107: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Would a refactor suffice?

It’s slow...

I Refactor hot code

I Find a faster implementation

It’s confusing...

I Fix your docs

I Prune dead code

I Simplify and refactor

I Build and document boundary where you would addcode

People are bored...

I Recognize contributions publicly

I Communicate costs of ill-concieved changes

I Gamify issue fixing

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 108: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Would a refactor suffice?

It’s slow...

I Refactor hot code

I Find a faster implementation

It’s confusing...

I Fix your docs

I Prune dead code

I Simplify and refactor

I Build and document boundary where you would addcode

People are bored...

I Recognize contributions publicly

I Communicate costs of ill-concieved changes

I Gamify issue fixing

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 109: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Would a refactor suffice?

It’s slow...

I Refactor hot code

I Find a faster implementation

It’s confusing...

I Fix your docs

I Prune dead code

I Simplify and refactor

I Build and document boundary where you would addcode

People are bored...

I Recognize contributions publicly

I Communicate costs of ill-concieved changes

I Gamify issue fixing

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 110: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Would a refactor suffice?

It’s slow...

I Refactor hot code

I Find a faster implementation

It’s confusing...

I Fix your docs

I Prune dead code

I Simplify and refactor

I Build and document boundary where you would addcode

People are bored...

I Recognize contributions publicly

I Communicate costs of ill-concieved changes

I Gamify issue fixing

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 111: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Would a refactor suffice?

It’s slow...

I Refactor hot code

I Find a faster implementation

It’s confusing...

I Fix your docs

I Prune dead code

I Simplify and refactor

I Build and document boundary where you would addcode

People are bored...

I Recognize contributions publicly

I Communicate costs of ill-concieved changes

I Gamify issue fixing

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 112: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Would a refactor suffice?

It’s slow...

I Refactor hot code

I Find a faster implementation

It’s confusing...

I Fix your docs

I Prune dead code

I Simplify and refactor

I Build and document boundary where you would addcode

People are bored...

I Recognize contributions publicly

I Communicate costs of ill-concieved changes

I Gamify issue fixing

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 113: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Would a refactor suffice?

It’s slow...

I Refactor hot code

I Find a faster implementation

It’s confusing...

I Fix your docs

I Prune dead code

I Simplify and refactor

I Build and document boundary where you would addcode

People are bored...

I Recognize contributions publicly

I Communicate costs of ill-concieved changes

I Gamify issue fixing

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 114: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Intro

Should you rewrite?Categorizing RewritesCommunicating about Code ChangesRewriting to understandCase studies: Rewriting to understand

Rewriting to deployWhat’s the smallest change that would solve yourproblem?Can Rust solve your problem?Case study: NPMCase study: Project QuantumRewriting vs green field

Rewriting techniquesFFI from Your LanguageStatic Linking RustOptional Tools

Q & A

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 115: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rust’s goals

I Memory safety

I C-like performance

I Minimal runtime

I Integration with other languages

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 116: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rust’s goals

I Memory safety

I C-like performance

I Minimal runtime

I Integration with other languages

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 117: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rust’s goals

I Memory safety

I C-like performance

I Minimal runtime

I Integration with other languages

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 118: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rust’s goals

I Memory safety

I C-like performance

I Minimal runtime

I Integration with other languages

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 119: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rust’s goals

I Memory safety

I C-like performance

I Minimal runtime

I Integration with other languages

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 120: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rusty choices

I Stable vs Nightly

I Safe vs Unsafe

I Libraries vs Binaries

I Dynamic vs static linking

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 121: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rusty choices

I Stable vs Nightly

I Safe vs Unsafe

I Libraries vs Binaries

I Dynamic vs static linking

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 122: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rusty choices

I Stable vs Nightly

I Safe vs Unsafe

I Libraries vs Binaries

I Dynamic vs static linking

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 123: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rusty choices

I Stable vs Nightly

I Safe vs Unsafe

I Libraries vs Binaries

I Dynamic vs static linking

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 124: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rusty choices

I Stable vs Nightly

I Safe vs Unsafe

I Libraries vs Binaries

I Dynamic vs static linking

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 125: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rust tools

I Rustup

I Cargo, crates.io

I Rustfmt

I Clippy

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 126: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rust tools

I Rustup

I Cargo, crates.io

I Rustfmt

I Clippy

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 127: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rust tools

I Rustup

I Cargo, crates.io

I Rustfmt

I Clippy

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 128: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rust tools

I Rustup

I Cargo, crates.io

I Rustfmt

I Clippy

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 129: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rust tools

I Rustup

I Cargo, crates.io

I Rustfmt

I Clippy

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 130: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Learning Rust?

I doc.rust-lang.org

I http://community.rs/resources

I 1:40pm Thursday, Rust Programming Techniques, NickCameron

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 131: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Learning Rust?

I doc.rust-lang.org

I http://community.rs/resources

I 1:40pm Thursday, Rust Programming Techniques, NickCameron

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 132: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Learning Rust?

I doc.rust-lang.org

I http://community.rs/resources

I 1:40pm Thursday, Rust Programming Techniques, NickCameron

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 133: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Learning Rust?

I doc.rust-lang.org

I http://community.rs/resources

I 1:40pm Thursday, Rust Programming Techniques, NickCameron

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 134: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Industry lessons

I Isolate a problem

I Rewrite to reduce risk

I Establish deployment workflow

I Small, expert team

I Incremental rewrite

I Educate larger teams later

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 135: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Industry lessons

I Isolate a problem

I Rewrite to reduce risk

I Establish deployment workflow

I Small, expert team

I Incremental rewrite

I Educate larger teams later

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 136: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Industry lessons

I Isolate a problem

I Rewrite to reduce risk

I Establish deployment workflow

I Small, expert team

I Incremental rewrite

I Educate larger teams later

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 137: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Industry lessons

I Isolate a problem

I Rewrite to reduce risk

I Establish deployment workflow

I Small, expert team

I Incremental rewrite

I Educate larger teams later

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 138: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Industry lessons

I Isolate a problem

I Rewrite to reduce risk

I Establish deployment workflow

I Small, expert team

I Incremental rewrite

I Educate larger teams later

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 139: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Industry lessons

I Isolate a problem

I Rewrite to reduce risk

I Establish deployment workflow

I Small, expert team

I Incremental rewrite

I Educate larger teams later

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 140: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Industry lessons

I Isolate a problem

I Rewrite to reduce risk

I Establish deployment workflow

I Small, expert team

I Incremental rewrite

I Educate larger teams later

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 141: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Case study: NPM

I github.com/ceejbot/npm-first-rust-service

I https://www.youtube.com/watch?v=GCsxYAxw3JQ

I Wrote proxy, replaced microservice with Rust version

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 142: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Case study: NPM

I github.com/ceejbot/npm-first-rust-service

I https://www.youtube.com/watch?v=GCsxYAxw3JQ

I Wrote proxy, replaced microservice with Rust version

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 143: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Case study: NPM

I github.com/ceejbot/npm-first-rust-service

I https://www.youtube.com/watch?v=GCsxYAxw3JQ

I Wrote proxy, replaced microservice with Rust version

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 144: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Case study: NPM

I github.com/ceejbot/npm-first-rust-service

I https://www.youtube.com/watch?v=GCsxYAxw3JQ

I Wrote proxy, replaced microservice with Rust version

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 145: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Case study: Project Quantum

I http://bholley.net/blog/2017/stylo.html

I https://blog.rust-lang.org/2017/11/14/

Fearless-Concurrency-In-Firefox-Quantum.html

I hacks.mozilla.org/2017/08/

inside-a-super-fast-css-engine-quantum-css-aka-stylo/

I “Rebuilding a jet engine in flight”

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 146: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Case study: Project Quantum

I http://bholley.net/blog/2017/stylo.html

I https://blog.rust-lang.org/2017/11/14/

Fearless-Concurrency-In-Firefox-Quantum.html

I hacks.mozilla.org/2017/08/

inside-a-super-fast-css-engine-quantum-css-aka-stylo/

I “Rebuilding a jet engine in flight”

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 147: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Case study: Project Quantum

I http://bholley.net/blog/2017/stylo.html

I https://blog.rust-lang.org/2017/11/14/

Fearless-Concurrency-In-Firefox-Quantum.html

I hacks.mozilla.org/2017/08/

inside-a-super-fast-css-engine-quantum-css-aka-stylo/

I “Rebuilding a jet engine in flight”

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 148: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Case study: Project Quantum

I http://bholley.net/blog/2017/stylo.html

I https://blog.rust-lang.org/2017/11/14/

Fearless-Concurrency-In-Firefox-Quantum.html

I hacks.mozilla.org/2017/08/

inside-a-super-fast-css-engine-quantum-css-aka-stylo/

I “Rebuilding a jet engine in flight”

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 149: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Case study: Project Quantum

I http://bholley.net/blog/2017/stylo.html

I https://blog.rust-lang.org/2017/11/14/

Fearless-Concurrency-In-Firefox-Quantum.html

I hacks.mozilla.org/2017/08/

inside-a-super-fast-css-engine-quantum-css-aka-stylo/

I “Rebuilding a jet engine in flight”

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 150: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rewriting vs green field

I https://www.rust-lang.org/en-US/friends.html

I Dropbox, Habitat, Coursera, etc

I Rewriting requires backwards compatibility.

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 151: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rewriting vs green field

I https://www.rust-lang.org/en-US/friends.html

I Dropbox, Habitat, Coursera, etc

I Rewriting requires backwards compatibility.

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 152: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rewriting vs green field

I https://www.rust-lang.org/en-US/friends.html

I Dropbox, Habitat, Coursera, etc

I Rewriting requires backwards compatibility.

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 153: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Rewriting vs green field

I https://www.rust-lang.org/en-US/friends.html

I Dropbox, Habitat, Coursera, etc

I Rewriting requires backwards compatibility.

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 154: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Intro

Should you rewrite?Categorizing RewritesCommunicating about Code ChangesRewriting to understandCase studies: Rewriting to understand

Rewriting to deployWhat’s the smallest change that would solve yourproblem?Can Rust solve your problem?Case study: NPMCase study: Project QuantumRewriting vs green field

Rewriting techniquesFFI from Your LanguageStatic Linking RustOptional Tools

Q & A

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 155: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

FFI from Your Language

I Foreign Function Interface

I Call guest language from host language

I github.com/alexcrichton/rust-ffi-examples

I https://doc.rust-lang.org/book/

first-edition/ffi.html

I cargo.toml, main.rs, main.pl, Makefile

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 156: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

FFI from Your Language

I Foreign Function Interface

I Call guest language from host language

I github.com/alexcrichton/rust-ffi-examples

I https://doc.rust-lang.org/book/

first-edition/ffi.html

I cargo.toml, main.rs, main.pl, Makefile

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 157: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

FFI from Your Language

I Foreign Function Interface

I Call guest language from host language

I github.com/alexcrichton/rust-ffi-examples

I https://doc.rust-lang.org/book/

first-edition/ffi.html

I cargo.toml, main.rs, main.pl, Makefile

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 158: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

FFI from Your Language

I Foreign Function Interface

I Call guest language from host language

I github.com/alexcrichton/rust-ffi-examples

I https://doc.rust-lang.org/book/

first-edition/ffi.html

I cargo.toml, main.rs, main.pl, Makefile

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 159: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

FFI from Your Language

I Foreign Function Interface

I Call guest language from host language

I github.com/alexcrichton/rust-ffi-examples

I https://doc.rust-lang.org/book/

first-edition/ffi.html

I cargo.toml, main.rs, main.pl, Makefile

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 160: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

FFI from Your Language

I Foreign Function Interface

I Call guest language from host language

I github.com/alexcrichton/rust-ffi-examples

I https://doc.rust-lang.org/book/

first-edition/ffi.html

I cargo.toml, main.rs, main.pl, Makefile

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 161: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

cargo.toml

[package]

name = "perl-to-rust"

version = "0.1.0"

#modified based on python version

authors = ["Hao Wu <[email protected]>"]

[lib]

name = "double_input"

crate-type = ["dylib"]

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 162: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

main.rs

#[no_mangle]

pub extern fn double_input(input: i32) -> i32 {

input * 2

}

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 163: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

main.pl

use v5.10;

use FFI::Raw;

my $double_input = FFI::Raw->new(

"target/debug/libdouble_input.so",

’double_input’,

FFI::Raw::int, # return value

FFI::Raw::int # arg #1

);

my $input = 4;

my $output = $double_input->call($input);

say $input . " * 2 = " . $output;

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 164: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Makefile

ifeq ($(shell uname),Darwin)

EXT := dylib

else

EXT := so

endif

all: target/debug/libdouble_input.$(EXT)

perl src/main.pl

target/debug/libdouble_input.$(EXT): src/lib.rs Cargo.toml

cargo build

clean:

rm -rf target

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 165: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Intro

Should you rewrite?Categorizing RewritesCommunicating about Code ChangesRewriting to understandCase studies: Rewriting to understand

Rewriting to deployWhat’s the smallest change that would solve yourproblem?Can Rust solve your problem?Case study: NPMCase study: Project QuantumRewriting vs green field

Rewriting techniquesFFI from Your LanguageStatic Linking RustOptional Tools

Q & A

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 166: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Static Linking Rust

I doc.rust-lang.org/reference/linkage.html

I https://doc.rust-lang.org/1.12.1/book/

advanced-linking.html#static-linking

I staticlib crate type

I

$ rustc --target=x86_64-unknown-linux-musl foo.rs

I Recompile dependencies with musl

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 167: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Static Linking Rust

I doc.rust-lang.org/reference/linkage.html

I https://doc.rust-lang.org/1.12.1/book/

advanced-linking.html#static-linking

I staticlib crate type

I

$ rustc --target=x86_64-unknown-linux-musl foo.rs

I Recompile dependencies with musl

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 168: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Static Linking Rust

I doc.rust-lang.org/reference/linkage.html

I https://doc.rust-lang.org/1.12.1/book/

advanced-linking.html#static-linking

I staticlib crate type

I

$ rustc --target=x86_64-unknown-linux-musl foo.rs

I Recompile dependencies with musl

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 169: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Static Linking Rust

I doc.rust-lang.org/reference/linkage.html

I https://doc.rust-lang.org/1.12.1/book/

advanced-linking.html#static-linking

I staticlib crate type

I

$ rustc --target=x86_64-unknown-linux-musl foo.rs

I Recompile dependencies with musl

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 170: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Static Linking Rust

I doc.rust-lang.org/reference/linkage.html

I https://doc.rust-lang.org/1.12.1/book/

advanced-linking.html#static-linking

I staticlib crate type

I

$ rustc --target=x86_64-unknown-linux-musl foo.rs

I Recompile dependencies with musl

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 171: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Static Linking Rust

I doc.rust-lang.org/reference/linkage.html

I https://doc.rust-lang.org/1.12.1/book/

advanced-linking.html#static-linking

I staticlib crate type

I

$ rustc --target=x86_64-unknown-linux-musl foo.rs

I Recompile dependencies with musl

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 172: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Intro

Should you rewrite?Categorizing RewritesCommunicating about Code ChangesRewriting to understandCase studies: Rewriting to understand

Rewriting to deployWhat’s the smallest change that would solve yourproblem?Can Rust solve your problem?Case study: NPMCase study: Project QuantumRewriting vs green field

Rewriting techniquesFFI from Your LanguageStatic Linking RustOptional Tools

Q & A

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 173: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Optional Tools

I usehelix.com, Ruby

I github.com/neon-bindings/neon, Node.js

I github.com/rust-lang-nursery/rust-bindgen, C

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 174: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Optional Tools

I usehelix.com, Ruby

I github.com/neon-bindings/neon, Node.js

I github.com/rust-lang-nursery/rust-bindgen, C

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 175: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Optional Tools

I usehelix.com, Ruby

I github.com/neon-bindings/neon, Node.js

I github.com/rust-lang-nursery/rust-bindgen, C

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 176: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Optional Tools

I usehelix.com, Ruby

I github.com/neon-bindings/neon, Node.js

I github.com/rust-lang-nursery/rust-bindgen, C

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 177: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Intro

Should you rewrite?Categorizing RewritesCommunicating about Code ChangesRewriting to understandCase studies: Rewriting to understand

Rewriting to deployWhat’s the smallest change that would solve yourproblem?Can Rust solve your problem?Case study: NPMCase study: Project QuantumRewriting vs green field

Rewriting techniquesFFI from Your LanguageStatic Linking RustOptional Tools

Q & A

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 178: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Questions

I Your project and mentors

I Host language docs

I irc.mozilla.org: #rust, #rust-beginners,#rust-community

I users.rust-lang.org

I www.rust-lang.org/team.html

I [email protected]

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 179: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Questions

I Your project and mentors

I Host language docs

I irc.mozilla.org: #rust, #rust-beginners,#rust-community

I users.rust-lang.org

I www.rust-lang.org/team.html

I [email protected]

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 180: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Questions

I Your project and mentors

I Host language docs

I irc.mozilla.org: #rust, #rust-beginners,#rust-community

I users.rust-lang.org

I www.rust-lang.org/team.html

I [email protected]

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 181: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Questions

I Your project and mentors

I Host language docs

I irc.mozilla.org: #rust, #rust-beginners,#rust-community

I users.rust-lang.org

I www.rust-lang.org/team.html

I [email protected]

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 182: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Questions

I Your project and mentors

I Host language docs

I irc.mozilla.org: #rust, #rust-beginners,#rust-community

I users.rust-lang.org

I www.rust-lang.org/team.html

I [email protected]

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 183: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Questions

I Your project and mentors

I Host language docs

I irc.mozilla.org: #rust, #rust-beginners,#rust-community

I users.rust-lang.org

I www.rust-lang.org/team.html

I [email protected]

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 184: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Questions

I Your project and mentors

I Host language docs

I irc.mozilla.org: #rust, #rust-beginners,#rust-community

I users.rust-lang.org

I www.rust-lang.org/team.html

I [email protected]

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Page 185: Should you rewrite in Rust? - talks.edunham.net/lca2018/rusttalks.edunham.net/lca2018/should-you-rewrite-in-rust/beamer.pdf · Rewriting to understand Case studies: Rewriting to understand

Should you rewritein Rust?

@qedunham

Intro

Should yourewrite?

Categorizing Rewrites

Communicating aboutCode Changes

Rewriting tounderstand

Case studies:Rewriting tounderstand

Rewriting todeploy

What’s the smallestchange that wouldsolve your problem?

Can Rust solve yourproblem?

Case study: NPM

Case study: ProjectQuantum

Rewriting vs greenfield

Rewritingtechniques

FFI from YourLanguage

Static Linking Rust

Optional Tools

Q & A

Stories

I Rewriting code

I Impact of others’ rewrites

I Fun with Rust

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/