class: middle, center # .highlight-yellow[zen] and the art of convincing your company to use .highlight-red[Rust] .motorcycle[![motocycle](public/images/motorcycle.png)] --- class: middle, center # hi i'm .highlight-yellow[@ag_dubs] .ag_dubs[![ag_dubs](public/images/ag_dubs.png)] --- class: middle, center .npm[![npm](public/images/npm.png)] --- class: middle, center .npm[![npm](public/images/npm2.png)] --- class: middle, center ![](public/images/packages.PNG) --- class: middle, center ![npm-stats](public/images/npm-stats.png) --- class: middle, center ![modulecounts](public/images/modulecounts.png) --- class: middle, center # npm is the # .highlight-red[LARGEST PACKAGE REGISTRY IN THE WORLD] --- class: middle, center ![](public/images/rust-friends.png) --- class: middle, center # npm uses .highlight-red[rust] --- class: middle, center # how do i convince .highlight-yellow[my company] to use .highlight-red[rust]? --- class: middle, left > The number of rational hypotheses that can explain any given phenomenon is infinite. .citation[Robert M. Pirsig, Zen and the Art of Motorcycle Maintenance: An Inquiry Into Values] --- class: middle, center .tip[10 tips] ### (that may or may not work for you but will almost definitely make you a better rustacean) --- class: middle, center ### .highlight-yellow[tip 1] # don't .highlight-red[rewrite] your software in rust .no[![](public/images/no.PNG)] --- class: middle, center ### .highlight-yellow[tip 1] # don't .highlight-yellow[completely] .highlight-red[rewrite] your software in rust .warn[![](public/images/warning.png)] --- class: middle, center # complete rewrites are .highlight-yellow[very often] .highlight-red[unsuccessful] .wreck[![](public/images/wreck.png)] --- class: middle, left > A complex system that works is invariably found to have evovled from > a simple system that worked. .highlight-red[A complex system designed] > .highlight-red[from scratch never works and cannot be patched up to make it work.] > .highlight-yellow[You have to start over with a simple system.] # john gall .doctor[![doctor](public/images/doctor.png)] --- class: middle, center .highlight-red[.tip[cheating]] .highlight-yellow[.tip[gall's law]] .tip-title[by cj silverio] .architecture[![architecture](public/images/architecture.png)] --- class: middle, center ![proxy](public/images/proxy.png) --- class: middle, center .microservices[![microservices](public/images/microservices.PNG)] # microservices --- class: middle, center .tip-title[.highlight-yellow[tip 2]] .tip[show up with code] --- class: middle, center ![tokio](public/images/tokio.png) --- class: middle, center # writing a registry follower in rust --- class: middle, center ![follower](public/images/follower1.PNG) --- class: middle, center ![follower](public/images/follower2.PNG) --- class: middle, center ![follower](public/images/follower-example.png) --- class: middle, center ![jsfollower](public/images/jsfollower.png) --- class: middle, center .tip-title[.highlight-yellow[tip 3]] .tip[.highlight-red[don't sell]] --- class: middle, center # .highlight-yellow[bashing other languages] makes everyone look .highlight-red[bad] --- class: middle, center # you don't have to .highlight-red[control] someone else's .highlight-yellow[first experience] of rust --- class: middle, center # not everyone is gonna .highlight-red[love] everything about rust -- # .highlight-yellow[right away] --- class: middle, center # `#![allow(bad_style)]` --- class: middle, center .tip-title[.highlight-yellow[tip 4]] .tip[sell sell sell] .advice[![advice](public/images/advice.PNG)] --- class: middle, center ![slack](public/images/slack.png) --- class: middle, center .slack2[![slack](public/images/slack2.png)] --- class: middle, center .twitter[![](public/images/twitter.png)] --- class: middle, center .twitterslack[![](public/images/slacktwitter.png)] --- class: middle, center .tip-title[.highlight-yellow[tip 5]] .tip[the hard part of programming isn't programming] --- class: top, left # docs - ### The Rust Reference - ### The Rust Book - ### The Rust Book (NEW AND UPDATED) - ### The Nomicon .docs[![docs](public/images/docs.png)] --- class: middle, left # tooling - ### `cargo` - ### `rustup` - ### `rustfmt` - ### `clippy` .tools[![tools](public/images/tools.PNG)] --- class: top, left # community - ### `#rust-beginners` on mozilla IRC - ### [exercism.io](http://www.exercism.io/) - ### RustConf, RustFest, RustBeltRust .community[![community](public/images/community.png)] --- class: middle, center # docs, community, and tooling may seem .highlight-yellow[easy] and .highlight-red[common] -- # they are neither --- class: middle, center .tip-title[.highlight-yellow[tip 6]] .tip[the hard part of programming is programming] .programming[![](public/images/programming.PNG)] --- class: middle, center # selling something on technical merit *is* .highlight-yellow[easy] --- class: middle, center .tip-title[.highlight-yellow[tip 7]] .tip[be prepared for things to .highlight-red[change]] --- class: top, left ### problem: # our node service logs are full of .highlight-yellow[runtime errors] # parsing them is **slow** .logs[![](public/images/logs.PNG)] --- class: middle, left > oh no my rust parser is 2x slower than the js version --- class: middle, center ![stdin-lock](public/images/stdin-lock.png) --- class: middle, center # `[0; 1024];` --- class: middle, left > i just fully expected to rust my way into 50% perf over js. sometimes i forget that v8 is pretty darn fast. --- class: middle, left > .highlight-yellow[You are never dedicated to something you have complete confidence in.] No one is > fanatically shouting that the sun is going to rise tomorrow. They know it's going > to rise tomorrow. When people are fanatically dedicated to political or religious > faiths or any other kinds of dogmas or goals, .highlight-red[it's always because these dogmas or] > .highlight-red[goals are in doubt.] .citation[Robert M. Pirsig, Zen and the Art of Motorcycle Maintenance: An Inquiry Into Values] --- class: middle, center # i thought i'd be selling rust because of its .highlight-yellow[speed] -- # ... but i'm selling rust because of its .highlight-red[safety] --- class: middle, center # making rust go fast is actually kinda hard .sonic[![sonic](public/images/sonic.PNG)] --- class: middle, center # making rust .highlight-red[correct] is .highlight-yellow[pretty simple]! --- class: middle, center .tip-title[tip 8] .tip[be prepared for things to stay the .highlight-yellow[same]] --- class: middle, center # boring code is my favorite code --- class: middle, center # just because you started using rust doesn't mean everything .highlight-red[will change] -- # in fact, it's .highlight-yellow[better if it doesn't]! --- class: middle, center ![science](public/images/science.png) # scientific method --- class: middle, center # only change .highlight-red[one thing] at a time so you can measure .highlight-yellow[rust's impact] .measure[![measure](public/images/measure.PNG)] --- class: middle, center # only change .highlight-red[one thing] so you don't burn everyone out .burnout[![burnout](public/images/burnout.PNG)] --- class: middle, center ![how we deploy](public/images/how-we-deploy.png) .citation[http://blog.npmjs.org/post/152035356435/how-we-deploy-at-npm] --- class: middle, center ![git-deploy-rust](public/images/git-deploy-rust.png) --- class: middle, center # we deploy rust using nearly the .highlight-yellow[exact same process] we deploy node --- class: middle, center .highlight-yellow[.tip-title[tip 9]] .tip[have a problem to solve] .sherlock[![sherlock](public/images/sherlock.png)] --- class: middle, center .trashfire[![trashfire](public/images/trashfire.PNG)] # (this should be easy because all software is terrible) --- class: middle, center # big numbers are big --- class: middle, center # over the last year # .real-big[70 billion] # downloads occured .citation[https://twitter.com/seldo/status/845094537752014852. 23 March 2017.] --- class: middle, center ![](public/images/rolling-downloads.jpg) .citation[https://twitter.com/seldo/status/845094537752014852. 23 March 2017.] --- class: middle, center # storefile transforms --- class: middle, center ![follower](public/images/follower2.PNG) --- class: middle, center # find a problematic part of your product and try rewriting it in rust --- class: middle, center .tip-title[tip 10] .tip[learning curves are a blessing in disguise] --- class: middle, left > this is the really fun part about learning new things. i still have the patience to do any number of silly things .teacher[![](public/images/teacher.png)] --- class: middle, center # learning something new can be .highlight-yellow[energizing] -- # even if (or maybe because!) it is .highlight-red[hard] --- class: middle, left # summary 1. don't rewrite your software in rust 2. show up with code 3. don't sell 4. sell sell sell 5. the hard part of programming is not programming 6. the hard part of programming is programming 7. be prepared for change 8. be prepared for things to stay the same 9. have a problem to solve 10. learning curves are a blessing in disguise --- class: middle, left > If you’re going to repair a motorcycle, an adequate supply of gumption is the first > and most important tool. If you haven’t got that you might as well gather up all > the other tools and put them away, because they won’t do you any good. .citation[Robert M. Pirsig, Zen and the Art of Motorcycle Maintenance: An Inquiry Into Values] --- class: middle, left # gumption ### **'ɡʌm(p)ʃ(ə)n/** #### noun, informal shrewd or spirited initiative and resourcefulness. synonyms: initiative, resourcefulness, enterprise, imagination, imaginativeness, ingenuity, inventiveness; class: middle, center --- class: middle, center # go forth and spread rust! --- class: middle, center # thanks! ### @ag_dubs, bit.ly/rustfest-2017 .motorcycle[![motorcycle](public/images/motorcycle.png)]