SlideShare a Scribd company logo
From NodeJS to Rust
The Whys and Hows
About me
● Bastian Gruber
● Developing Software for about
10 years
● Mainframe (PL/I), Java,
Angular/React, Python, NodeJS,
Rust (Go, Lua, C#...)
● Writing paid, production-ready
Rust for about 10 months
● Pragmatic :)
gruberbastian.com
gruberbastian@me.com
Talk goals
● Why choosing Rust
● Core differences between
NodeJS and Rust
● What to learn in the beginning
● Quick start into web dev
● Learning path
● What to do with Rust
● Real-life experiences using Rust
in production
WHY?
● New markets need different
systems/languages
● More fields to work in
● New mindset instead of just a
new Syntax
● Grow as a professionalPERSONAL
WHY?
● No need for TypeScript
● No need for third-party tooling*
● Shipping a binary
● People can get on boarded
with a book
● High quality content (blog
posts, books, code)
● More performant
● Pair programming with the
compiler
● ….
NODEJS
NodeJS vs. Rust
● cargo new PROJECT
● Adding dependencies by hand*
● crates.io
● Cargo.toml
● cargo run
● cargo check
● cargo build
● cargo test
● Doc-comments with tested code-
examples (always up-to-date)
● RICH language features
● Be able to run as a static binary
NodeJS vs. Rust
● mkdir PROJECT && cd && npm init
● npm install
● npm
● Package.json
● npm run
EXTRA TOOLING NEEDED FOR TYPES,
TESTING AND BUNDLING
Befriend the compiler
Reading documentation
Types
No “undefined”
Mindset: Systems Programming Language (no runtime)
Mindset
Web Development with Rust
Futures and Runtimes
Runtimes
● Instead of using the OS threads, a runtime is creating its own “event loop”
● Futures are getting passed onto the runtime
● Runtime drives the Futures to a conclusion
● Application is getting notified that a return value is available
● Tokio
● Async-std
● ….
Runtimes (tokio)
Web Dev Stack
Crates for Web Development
● TCP included in Rust
● Tokio-stack:
○ hyper (HTTP implementation/server)
○ tonic (GRPC)
○ warp (web-server framework)
● Actix-web
● rocket
● serde(_json)
● reqwest
Rocket
actix-web
warp
reqwest
Rust example
Live coding (fetching something form an open api, using first no type to print out
the result, and then creating a type, using serde_json etc.)
What to build with Rust?
!!EVERYTHING!!
What to build with Rust?
● Web Applications
● APIs
● Servers
● Databases
● Operating Systems
● Games
● Software for embedded devices
● …..
Rust learning path
To buy
● “The Rust Programming Language” (NoStarch)
● “Programming Rust” (o’reilly)
● “Rust in Action” (MEAP)
Signup
● exercism.io
● Rust Discord
● Rust MeetUps
○ “Rust Hack and Learn”
○ “Rust and Tell”
Rust learning path
Practice path I
● Read first 2 chapters of “TRPL”
● Do 4-5 easy exercism.io exercises
● Build a CLI application and use docs and TRPL
● Do one exercism.io exercise every day + use “Programming
Rust” and docs as reference
● Watch videos from Jon Gjengset
● Read “Rust in Action”
● Build redis-clone
Rust learning path
Practice path II
● Read first 2 chapters of “TRPL”
● Do 3 exercism.io exercises a day/for a month (+
books/docs)
● Start to build a web service and use docs/books to help
Real world experiences with Rust
+ Be able to change code everywhere and anytime (thanks compiler)
+ Be able to strongly type your codebase (refactoring, reasoning)
+ Compiler, crates, docs,...
+/- Developers from different backgrounds
+/- Don’t want to program in any other language anymore
- Not “easy going” mindset as the NodeJS community/developers (so far)
THANK YOU!

More Related Content

What's hot

Introducing Yeoman 1.0 beta
Introducing Yeoman 1.0 betaIntroducing Yeoman 1.0 beta
Introducing Yeoman 1.0 beta
digitalzombie
 

What's hot (20)

Why don't you Groovy?
Why don't you Groovy?Why don't you Groovy?
Why don't you Groovy?
 
Ruxmon.2015-08.-.proxenet
Ruxmon.2015-08.-.proxenetRuxmon.2015-08.-.proxenet
Ruxmon.2015-08.-.proxenet
 
Understanding how concurrency work in os
Understanding how concurrency work in osUnderstanding how concurrency work in os
Understanding how concurrency work in os
 
three.js WebGL library presentation
three.js WebGL library presentationthree.js WebGL library presentation
three.js WebGL library presentation
 
Growing up new PostgreSQL developers (pgcon.org 2018)
Growing up new PostgreSQL developers (pgcon.org 2018)Growing up new PostgreSQL developers (pgcon.org 2018)
Growing up new PostgreSQL developers (pgcon.org 2018)
 
Monorepo at Pinterest
Monorepo at PinterestMonorepo at Pinterest
Monorepo at Pinterest
 
Quality Assurance in PostgreSQL
Quality Assurance in PostgreSQLQuality Assurance in PostgreSQL
Quality Assurance in PostgreSQL
 
What's unique to Qt
What's unique to QtWhat's unique to Qt
What's unique to Qt
 
C4ainaction-Introduction to the Pyramid Web Framework
C4ainaction-Introduction to the Pyramid Web FrameworkC4ainaction-Introduction to the Pyramid Web Framework
C4ainaction-Introduction to the Pyramid Web Framework
 
Atomic Developer Bundle
Atomic Developer BundleAtomic Developer Bundle
Atomic Developer Bundle
 
Introducing CentOS container pipeline
Introducing CentOS container pipelineIntroducing CentOS container pipeline
Introducing CentOS container pipeline
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
Typescript - MentorMate Academy
Typescript - MentorMate AcademyTypescript - MentorMate Academy
Typescript - MentorMate Academy
 
Python Django Basics
Python Django BasicsPython Django Basics
Python Django Basics
 
Geb+spock: let your functional tests live long and prosper
Geb+spock: let your functional tests live long and prosperGeb+spock: let your functional tests live long and prosper
Geb+spock: let your functional tests live long and prosper
 
Internship at CloudFactory
Internship at CloudFactoryInternship at CloudFactory
Internship at CloudFactory
 
Beginning python programming
Beginning python programmingBeginning python programming
Beginning python programming
 
Ros session 1
Ros session 1Ros session 1
Ros session 1
 
Profile all the things! - Capital Go 2017
 Profile all the things! - Capital Go 2017 Profile all the things! - Capital Go 2017
Profile all the things! - Capital Go 2017
 
Introducing Yeoman 1.0 beta
Introducing Yeoman 1.0 betaIntroducing Yeoman 1.0 beta
Introducing Yeoman 1.0 beta
 

Similar to From NodeJS to Rust

Intro to web
Intro to webIntro to web
Intro to web
zgohr
 

Similar to From NodeJS to Rust (20)

Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
 
Why and How You Should Move from PHP to Node.js
Why and How You Should Move from PHP to Node.jsWhy and How You Should Move from PHP to Node.js
Why and How You Should Move from PHP to Node.js
 
Intro to web
Intro to webIntro to web
Intro to web
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
 
New paradigms
New paradigmsNew paradigms
New paradigms
 
An overview of node.js
An overview of node.jsAn overview of node.js
An overview of node.js
 
Node.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleNode.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scale
 
Dmytro Dziubenko "Developer's toolchain"
Dmytro Dziubenko "Developer's toolchain"Dmytro Dziubenko "Developer's toolchain"
Dmytro Dziubenko "Developer's toolchain"
 
Node js for beginners
Node js for beginnersNode js for beginners
Node js for beginners
 
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special EditionIntroduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition
 
Adopting language server for apache camel feedback from a java/Eclipse plugi...
Adopting language server for apache camel  feedback from a java/Eclipse plugi...Adopting language server for apache camel  feedback from a java/Eclipse plugi...
Adopting language server for apache camel feedback from a java/Eclipse plugi...
 
Introduction to react native @ TIC NUST
Introduction to react native @ TIC NUSTIntroduction to react native @ TIC NUST
Introduction to react native @ TIC NUST
 
Nodejs
NodejsNodejs
Nodejs
 
The Professional Programmer
The Professional ProgrammerThe Professional Programmer
The Professional Programmer
 
An overview of data and web-application development with Python
An overview of data and web-application development with PythonAn overview of data and web-application development with Python
An overview of data and web-application development with Python
 
DrupalCon Europe 2020 Low Code
DrupalCon Europe 2020 Low CodeDrupalCon Europe 2020 Low Code
DrupalCon Europe 2020 Low Code
 
.Net Core
.Net Core.Net Core
.Net Core
 
Lua as a business logic language in high load application
Lua as a business logic language in high load applicationLua as a business logic language in high load application
Lua as a business logic language in high load application
 
HTML, CSS & Javascript Architecture (extended version) - Jan Kraus
HTML, CSS & Javascript Architecture (extended version) - Jan KrausHTML, CSS & Javascript Architecture (extended version) - Jan Kraus
HTML, CSS & Javascript Architecture (extended version) - Jan Kraus
 
Node.js vs. python
Node.js vs. pythonNode.js vs. python
Node.js vs. python
 

Recently uploaded

Laundry management system project report.pdf
Laundry management system project report.pdfLaundry management system project report.pdf
Laundry management system project report.pdf
Kamal Acharya
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
Kamal Acharya
 
Digital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfDigital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdf
AbrahamGadissa
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
Hall booking system project report .pdf
Hall booking system project report  .pdfHall booking system project report  .pdf
Hall booking system project report .pdf
Kamal Acharya
 

Recently uploaded (20)

weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
 
Laundry management system project report.pdf
Laundry management system project report.pdfLaundry management system project report.pdf
Laundry management system project report.pdf
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
 
Introduction to Casting Processes in Manufacturing
Introduction to Casting Processes in ManufacturingIntroduction to Casting Processes in Manufacturing
Introduction to Casting Processes in Manufacturing
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
fluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answerfluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answer
 
Digital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfDigital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdf
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
 
Scaling in conventional MOSFET for constant electric field and constant voltage
Scaling in conventional MOSFET for constant electric field and constant voltageScaling in conventional MOSFET for constant electric field and constant voltage
Scaling in conventional MOSFET for constant electric field and constant voltage
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
Construction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptxConstruction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptx
 
Cloud-Computing_CSE311_Computer-Networking CSE GUB BD - Shahidul.pptx
Cloud-Computing_CSE311_Computer-Networking CSE GUB BD - Shahidul.pptxCloud-Computing_CSE311_Computer-Networking CSE GUB BD - Shahidul.pptx
Cloud-Computing_CSE311_Computer-Networking CSE GUB BD - Shahidul.pptx
 
A case study of cinema management system project report..pdf
A case study of cinema management system project report..pdfA case study of cinema management system project report..pdf
A case study of cinema management system project report..pdf
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
Hall booking system project report .pdf
Hall booking system project report  .pdfHall booking system project report  .pdf
Hall booking system project report .pdf
 
The Ultimate Guide to External Floating Roofs for Oil Storage Tanks.docx
The Ultimate Guide to External Floating Roofs for Oil Storage Tanks.docxThe Ultimate Guide to External Floating Roofs for Oil Storage Tanks.docx
The Ultimate Guide to External Floating Roofs for Oil Storage Tanks.docx
 

From NodeJS to Rust

  • 1. From NodeJS to Rust The Whys and Hows
  • 2. About me ● Bastian Gruber ● Developing Software for about 10 years ● Mainframe (PL/I), Java, Angular/React, Python, NodeJS, Rust (Go, Lua, C#...) ● Writing paid, production-ready Rust for about 10 months ● Pragmatic :) gruberbastian.com gruberbastian@me.com
  • 3. Talk goals ● Why choosing Rust ● Core differences between NodeJS and Rust ● What to learn in the beginning ● Quick start into web dev ● Learning path ● What to do with Rust ● Real-life experiences using Rust in production
  • 4. WHY? ● New markets need different systems/languages ● More fields to work in ● New mindset instead of just a new Syntax ● Grow as a professionalPERSONAL
  • 5. WHY? ● No need for TypeScript ● No need for third-party tooling* ● Shipping a binary ● People can get on boarded with a book ● High quality content (blog posts, books, code) ● More performant ● Pair programming with the compiler ● …. NODEJS
  • 7. ● cargo new PROJECT ● Adding dependencies by hand* ● crates.io ● Cargo.toml ● cargo run ● cargo check ● cargo build ● cargo test ● Doc-comments with tested code- examples (always up-to-date) ● RICH language features ● Be able to run as a static binary NodeJS vs. Rust ● mkdir PROJECT && cd && npm init ● npm install ● npm ● Package.json ● npm run EXTRA TOOLING NEEDED FOR TYPES, TESTING AND BUNDLING
  • 8. Befriend the compiler Reading documentation Types No “undefined” Mindset: Systems Programming Language (no runtime) Mindset
  • 11. Runtimes ● Instead of using the OS threads, a runtime is creating its own “event loop” ● Futures are getting passed onto the runtime ● Runtime drives the Futures to a conclusion ● Application is getting notified that a return value is available ● Tokio ● Async-std ● ….
  • 14. Crates for Web Development ● TCP included in Rust ● Tokio-stack: ○ hyper (HTTP implementation/server) ○ tonic (GRPC) ○ warp (web-server framework) ● Actix-web ● rocket ● serde(_json) ● reqwest
  • 17. warp
  • 19. Rust example Live coding (fetching something form an open api, using first no type to print out the result, and then creating a type, using serde_json etc.)
  • 20. What to build with Rust? !!EVERYTHING!!
  • 21. What to build with Rust? ● Web Applications ● APIs ● Servers ● Databases ● Operating Systems ● Games ● Software for embedded devices ● …..
  • 22. Rust learning path To buy ● “The Rust Programming Language” (NoStarch) ● “Programming Rust” (o’reilly) ● “Rust in Action” (MEAP) Signup ● exercism.io ● Rust Discord ● Rust MeetUps ○ “Rust Hack and Learn” ○ “Rust and Tell”
  • 23. Rust learning path Practice path I ● Read first 2 chapters of “TRPL” ● Do 4-5 easy exercism.io exercises ● Build a CLI application and use docs and TRPL ● Do one exercism.io exercise every day + use “Programming Rust” and docs as reference ● Watch videos from Jon Gjengset ● Read “Rust in Action” ● Build redis-clone
  • 24. Rust learning path Practice path II ● Read first 2 chapters of “TRPL” ● Do 3 exercism.io exercises a day/for a month (+ books/docs) ● Start to build a web service and use docs/books to help
  • 25. Real world experiences with Rust + Be able to change code everywhere and anytime (thanks compiler) + Be able to strongly type your codebase (refactoring, reasoning) + Compiler, crates, docs,... +/- Developers from different backgrounds +/- Don’t want to program in any other language anymore - Not “easy going” mindset as the NodeJS community/developers (so far)