Slide 1

Slide 1 text

Performance first

Slide 2

Slide 2 text

History behind Node.js

Slide 3

Slide 3 text

What's Node.js for • Node is designed to build scalable network applications • Node is similar in design to, and influenced by, systems like Ruby's Event Machine or Python's Twisted • Just because Node is designed without threads, doesn't mean you cannot take advantage of multiple cores in your environment.

Slide 4

Slide 4 text

History behind Rust

Slide 5

Slide 5 text

Why Rust exists? • There is too little attention paid to safety • They have poor concurrency support • There is a lack of practical affordances • They offer limited control over resources

Slide 6

Slide 6 text

How fast is Rust • Fast! Rust is already competitive with idiomatic C and C++ in a number of benchmarks • Rust takes zero-cost abstractions as one of its core principles: none of Rust’s abstractions impose a global performance penalty, nor is there overhead from any runtime system in the traditional sense.

Slide 7

Slide 7 text

Goals for Rust • Design and Implement a safe, concurrent, practical systems language • Provides both efficient code and a comfortable level of abstraction

Slide 8

Slide 8 text

Non Goals for Rust • We do not demand that Rust run on “every possible platform”. It must eventually work without unnecessary compromises on widely-used hardware and software platforms. • We do not intend to cover the complete feature-set of C++, or any other language. Rust should provide majority-case features. • We do not intend to be 100% static, 100% safe, 100% reflective, or too dogmatic in any other sense. Trade-offs exist.

Slide 9

Slide 9 text

Workshop time

Slide 10

Slide 10 text

Hello world en Node.js Step 1

Slide 11

Slide 11 text

Hello world en Rust Step 2

Slide 12

Slide 12 text

FFI ( Node.js + Rust ) Step 3 & 4

Slide 13

Slide 13 text

Neon ( Node.js + Rust ) Step 5 & 6

Slide 14

Slide 14 text

Neon ( Node.js + Rust ) Complex example - Step 7

Slide 15

Slide 15 text

So, what just happened?

Slide 16

Slide 16 text

Advantages - Rust & Node.js • The performance increase is not the only advantage, the consolidation of processes simplifies the deployment strategy, troubleshooting and maintenance.

Slide 17

Slide 17 text

Disadvantages - Rust & Node.js • Get a negligible gain in exchange for an implementation that doesn't scale • Sometimes writing a native module in Rust might not be easier, but would be the best answer for performance problems

Slide 18

Slide 18 text

Thanks Giovanny Gongora - @Gioyik