Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
SkillSwap node.js
Search
Seth Vargo
September 08, 2012
Technology
2
200
SkillSwap node.js
These are the slides from my tech talk given at skill swap at CMU for SkillSwap Weekend.
Seth Vargo
September 08, 2012
Tweet
Share
More Decks by Seth Vargo
See All by Seth Vargo
Taming the Modern Data Center
sethvargo
11
880
The Ecological Impact of Compute
sethvargo
6
280
Using Terraform with AWS
sethvargo
2
740
Scheduling Applications at Scale
sethvargo
6
510
Easy Ruby Development and Deployment with Otto
sethvargo
0
240
Building the World's Largest Websites
sethvargo
5
530
Consul as a Monitoring Service
sethvargo
22
4k
Introduction to Vault
sethvargo
10
2.8k
Vagrant 101 for Designers and Frontend Engineers
sethvargo
1
520
Other Decks in Technology
See All in Technology
上長や社内ステークホルダーに対する解像度を上げて、より良い補完関係を築く方法 / How-to-increase-resolution-and-build-better-complementary-relationships-with-your-bosses-and-internal-stakeholders
madoxten
13
7.9k
OpenTelemetry Collector internals
ymotongpoo
5
560
API の仕様から紐解く「MCP 入門」 ~MCP の「コンテキスト」って何だ?~
cdataj
0
170
「実体」で築く共通認識: 開発現場のコミュニケーション最適化 / Let's Get on the Same Page with Concrete Artifacts: Optimization of Communication in dev teams
kazizi55
0
150
Workflows から Agents へ ~ 生成 AI アプリの成長過程とアプローチ~
belongadmin
3
170
新規プロダクト開発、AIでどう変わった? #デザインエンジニアMeetup
bengo4com
0
490
Model Mondays S2E02: Model Context Protocol
nitya
0
120
Observability infrastructure behind the trillion-messages scale Kafka platform
lycorptech_jp
PRO
0
110
菸酒生在 LINE Taiwan 的後端雙刀流
line_developers_tw
PRO
0
460
Agentic DevOps時代の生存戦略
kkamegawa
0
620
CI/CDとタスク共有で加速するVibe Coding
tnbe21
0
220
OCI Oracle Database Services新機能アップデート(2025/03-2025/05)
oracle4engineer
PRO
1
190
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
480
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
43
2.4k
A Modern Web Designer's Workflow
chriscoyier
693
190k
The Language of Interfaces
destraynor
158
25k
Bash Introduction
62gerente
614
210k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
It's Worth the Effort
3n
184
28k
4 Signs Your Business is Dying
shpigford
184
22k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
16
930
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.8k
Transcript
node.js
node
t f g sethvargo
fuck shit dammit ass
what’s node?
event-driven non-blocking server-side
event-driven non-blocking server-side javascript
node’s goal is to provide an easy way to build
scalable network programs
node’s goal is to provide an easy way to build
scalable programs
make shit
make shit ^ better
make shit ^ better ™
Google V8 Engine
Google V8 Engine Makes Javascript really fucking fast ^
this is node
var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type':
'text/plain'}); res.end('Hello World\n'); }).listen(1337, '127.0.0.1'); console.log('Server running at http://127.0.0.1:1337/');
complete webserver
var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type':
'text/plain'}); res.end('Hello World\n'); }).listen(1337, '127.0.0.1'); console.log('Server running at http://127.0.0.1:1337/'); 1 2 3 4 5 6 7 8 ... in just 8 lines
that was node
why node?
new technology
new technology
existing technology
existing technology repurposed
existing technology repurposed patterns
fucking package it has a manager
node package manager
npm
an amazing community
14,350 packages
write less do more
asychronous I/O
“Get the fuck off of my CPU”
var data = file.read('scotty-labs.txt'); complexFileOperation(data); Old I/O
var data = file.read('scotty-labs.txt'); // Tie up the CPU while
I read that file complexFileOperation(data); Old I/O
I want to write the most inefficient program for your
CPU
I want to write the most inefficient program for your
CPU - no one, ever “ ”
Yet you do it every fucking day!
is I/O blocking Ruby Python Java SQL PHP
is I/O blocking Ruby Python Java SQL PHP by default
node is asynchronous
node has asynchronous I/O
var data = file.read('scotty-labs.txt', function(data) { complexFileOperation(data); }); // let
the CPU keep working in the meantime otherFunction(); New I/O
event-driven behavior
after I do this, I need to do that
after I do this, I need to do that
after this, do that
if x, then y
when I’m done shopping, I need to pay the bill
the Ruby way while(!poor) do (@amount ||= 0) += shop
end pay(@amount)
that makes 0 sense
the node way shop(function(amount) { pay(amount); });
fundamentally different way of thinking
fundamentally different type of programming
fundamentally different
and that’s okay
sometimes it really fucking sucks
there’s only one thread
Yay! No threading!
Shit! No threading!
var data = file.read('scotty-labs.txt', function(data) { complexFileOperation(data); }); // let
the CPU keep working in the meantime while(true) { ... } what does this do?
var data = file.read('scotty-labs.txt', function(data) { complexFileOperation(data); }); // let
the CPU keep working in the meantime while(true) { ... } what does this do?
var data = file.read('scotty-labs.txt', function(data) { // never fires });
// blocks the entire thread while(true) { ... } what does this do?
var data = file.read('scotty-labs.txt', function(data) { // never fires });
// blocks the entire thread while(true) { ... } nothing...
“my algorithms are tightly CPU-bound “
“my algorithms are tightly CPU-bound “ don’t use node
let’s code
catman
annoying 5 year old
tcp chat