SlideShare a Scribd company logo
Patrick Kettner - JavaScript without javascript
Patrick Kettner
Patrick Kettner
Program Manager
Microsoft Edge
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
:[:D
O
Patrick Kettner - JavaScript without javascript
Lexing
Parsing
Code Gen
Lexing
“hey, that’s a keyword!”“and that’s an identifier!”“thats an integer!”“another integer!”“oh cool! an addition operator”“looks like an assignment operator”
var sum = 1 + 2var sum=1+2
keyword identifier assignment int addition int
still lexestokens
21=sum +
identifier assignment int addition int
var
keyword
Parsing
, called sumset a variable
and assign it the value of
the integer 1 , in addition to ,
the integer 2
var sum = 1 + 2var sum=1+2
keyword identifier assignment int addition int
Code Gen
Program
VariableDeclaration
sum +
1 2
set a variable,
called sum
assign the value of
the integer 1,
in addition to
the integer 2
set a variable,
called sum
assign the value of
the integer 1,
in addition to
the integer 2
Abstract
Syntax
Tree
Abstract
Syntax
Tree
Program
VariableDeclaration
sum +
1 2
var sum = 1 + 2
#opal_sass.rb
require 'opal'
require 'opal-parser'
require 'sass'
def sassBuilder(str, opts)
Sass::Engine.new(str, opts).render
end
#opal_sass.rb
require 'opal'
require 'opal-parser'
require 'sass'
def sassBuilder(str, opts)
Sass::Engine.new(str, opts).render
end
#opal_sass.rb
require 'opal'
require 'opal-parser'
require 'sass'
def sassBuilder(str, opts)
Sass::Engine.new(str, opts).render
end
#opal_sass.rb
require 'opal'
require 'opal-parser'
require 'sass'
def sassBuilder(str, opts)
Sass::Engine.new(str, opts).render
end
#opal_sass.rb
require 'opal'
require 'opal-parser'
require 'sass'
def sassBuilder(str, opts)
Sass::Engine.new(str, opts).render
end
#opal_sass.rb
require 'opal'
require 'opal-parser'
require 'sass'
def sassBuilder(str, opts)
Sass::Engine.new(str, opts).render
end
#opal_sass.rb
require 'opal'
require 'opal-parser'
require 'sass'
def sassBuilder(str, opts)
Sass::Engine.new(str, opts).render
end
#opal_sass.rb
require 'opal'
require 'opal-parser'
require 'sass'
def sassBuilder(str, opts)
Sass::Engine.new(str, opts).render
end
Patrick Kettner - JavaScript without javascript
<!doctype html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<script src="./opal_sass.js"></script>
</body>
</html>
Patrick Kettner - JavaScript without javascript
The
first time
1. It never
works.
1.
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
2. Tools
aren’t
perfect.
2.
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
Every time
3. It is super
tedious.
3.
So simplify
when you
can
Patrick Kettner - JavaScript without javascript
Sass
Opal
Gemfile/Deps
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
https://OfflineSass.club
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
4. Test
Everything
4.
Reuse tests
whenever
possible
…
def test_rgb_percent
assert_equal("#123457", evaluate("rgb(7.1%, 20.4%, 34%)"))
assert_equal("#beaded", evaluate("rgb(74.7%, 173, 93%)"))
assert_equal("#beaded", evaluate("rgb(190, 68%, 237)"))
assert_equal("#00ff80", evaluate("rgb(0%, 100%, 50%)"))
end
def test_rgb_clamps_bounds
assert_equal("#ff0101", evaluate("rgb(256, 1, 1)"))
assert_equal("#01ff01", evaluate("rgb(1, 256, 1)"))
assert_equal("#0101ff", evaluate("rgb(1, 1, 256)"))
assert_equal("#01ffff", evaluate("rgb(1, 256, 257)"))
assert_equal("#000101", evaluate("rgb(-1, 1, 1)"))
end
def test_rgb_clamps_percent_bounds
assert_equal("red", evaluate("rgb(100.1%, 0, 0)"))
assert_equal("black", evaluate("rgb(0, -0.1%, 0)"))
assert_equal("blue", evaluate("rgb(0, 0, 101%)"))
end
def test_rgb_tests_types
assert_error_message("$red: "foo" is not a number for `rgb'",
Patrick Kettner - JavaScript without javascript
80 Versions
Automatically generated
(That’s 7 years of sass)
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
Two Point
Seven
Megabytes
sass-3.4.23.js.gz –
2.7mb
sass-3.4.23.js.br –
250kb
Patrick Kettner - JavaScript without javascript
asm.js
Alon Zakai
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
L L V M
O E I A
W V R C
E T H
L U I
A N
L E
0101010
0101010101010
0101010101010101010
0101010101010101010101010
01010101010101010101010101010
010101010101 01010101010
0101010101 0101010101
01010101 01010101
0101010 0101 01010101
010101 010101010 01010101010
010101 01010101010101010101010
010101 0101010101010101 0101 01
010101 0101010101010101 0101 01
010101 01010101010101010101010
010101 010101010 01010101010
0101010 01010 01010101
01010101 01010101
0101010101 0101010101
010101010101 010101010101
0101010101010101010101010101010
0101010101010101010101010
0101010101010101010
0101010101
0101
asm.js
Patrick Kettner - JavaScript without javascript
function cX(b) {
b = b | 0;
var d = 0,
f = 0,
sp(31416, (x = i, i = i + 40 | 0, c[x >> 2] = c[b + 80 >> 2], c[x + 8 >> 2] = n, c[x + 16
>> 2] = p, c[x + 24 >> 2] = l, c[x + 32 >> 2] = j, x) | 0);
j = c[b + 84 >> 2] | 0;
l = c[b + 100 >> 2] | 0;
p = c[b + 116 >> 2] | 0;
n = c[b + 132 >> 2] | 0;
k = ii(b) | 0;
sp(31280, (x = i, i = i + 40 | 0, c[x >> 2] = j, c[x + 8 >> 2] = l, c[x + 16 >> 2] = p, c[x
+ 24 >> 2] = n, c[x + 32 >> 2] = k, x) | 0);
k = c[b + 104 >> 2] | 0;
n = c[b + 120 >> 2] | 0;
p = c[b + 136 >> 2] | 0;
l = b + 188 | 0;
j = b + 140 | 0;
q = c[((a[l] | 0) == 0 ? j : b + 152 | 0) >> 2] | 0;
sp(31168, (x = i, i = i + 40 | 0, c[x >> 2] = c[b + 88 >> 2], c[x + 8 >> 2] = k, c[x + 16
>> 2] = n, c[x + 24 >> 2] = p, c[x + 32 >> 2] = q, x) | 0);
q = c[b + 92 >> 2] | 0;
p = c[b + 108 >> 2] | 0;
n = c[b + 124 >> 2] | 0;
function cX(b) {
b = b | 0;
var d = 0,
f = 0,
sp(31416, (x = i, i = i + 40 | 0, c[x >> 2] = c[b + 80 >> 2], c[x + 8 >> 2] = n, c[x + 16
>> 2] = p, c[x + 24 >> 2] = l, c[x + 32 >> 2] = j, x) | 0);
j = c[b + 84 >> 2] | 0;
l = c[b + 100 >> 2] | 0;
p = c[b + 116 >> 2] | 0;
n = c[b + 132 >> 2] | 0;
k = ii(b) | 0;
sp(31280, (x = i, i = i + 40 | 0, c[x >> 2] = j, c[x + 8 >> 2] = l, c[x + 16 >> 2] = p, c[x
+ 24 >> 2] = n, c[x + 32 >> 2] = k, x) | 0);
k = c[b + 104 >> 2] | 0;
n = c[b + 120 >> 2] | 0;
p = c[b + 136 >> 2] | 0;
l = b + 188 | 0;
j = b + 140 | 0;
q = c[((a[l] | 0) == 0 ? j : b + 152 | 0) >> 2] | 0;
sp(31168, (x = i, i = i + 40 | 0, c[x >> 2] = c[b + 88 >> 2], c[x + 8 >> 2] = k, c[x + 16
>> 2] = n, c[x + 24 >> 2] = p, c[x + 32 >> 2] = q, x) | 0);
q = c[b + 92 >> 2] | 0;
p = c[b + 108 >> 2] | 0;
n = c[b + 124 >> 2] | 0;
| 0
x + 2
x is a…
string?
object?
int?
x=(x|0); x + 2
x is a…
string?
object?
int?
x is a…
string?
object?
int?
https://github.com/kripken/sql.js
https://quakejs.com
Patrick Kettner - JavaScript without javascript
asm.js
Patrick Kettner - JavaScript without javascript
Lexing
Parsing
Code Gen
Lexing
Parsing
Code Gen
Patrick Kettner - JavaScript without javascript
VIRTUAL DOM REAL DOM
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
Patrick Kettner - JavaScript without javascript
5. Try
something
dumb
5.
Thanks!
patket@microsoft.com
@patrickkettner

More Related Content

PPTX
Javascript Without Javascript
PPTX
8.2 integration by parts
DOCX
Caropro
PDF
Tabela completa de derivadas e integrais
PDF
Integrales
PDF
Tablas integrales
PDF
Integrales
PDF
Tabla integrales
Javascript Without Javascript
8.2 integration by parts
Caropro
Tabela completa de derivadas e integrais
Integrales
Tablas integrales
Integrales
Tabla integrales

What's hot (16)

DOCX
Funcion cuadratica
PDF
graphics Assidnment
PPTX
Aditazz 01-ul
PDF
PDF
Human-powered Javascript Compression for Fun and Gummy Bears
KEY
cocos2d 事例編 HungryMasterの実装から
DOC
Seg code
PDF
The Ring programming language version 1.6 book - Part 55 of 189
DOCX
Numerical Method Assignment
PDF
Wzory statystyka
PDF
Tabela derivadas-e-integrais
PDF
Clojure functions examples
PDF
Documento de acrobat2
DOCX
Programming assignment 30 12-11
DOCX
Include stdio. wps office (1)
KEY
Cocos2dを使ったゲーム作成の事例
Funcion cuadratica
graphics Assidnment
Aditazz 01-ul
Human-powered Javascript Compression for Fun and Gummy Bears
cocos2d 事例編 HungryMasterの実装から
Seg code
The Ring programming language version 1.6 book - Part 55 of 189
Numerical Method Assignment
Wzory statystyka
Tabela derivadas-e-integrais
Clojure functions examples
Documento de acrobat2
Programming assignment 30 12-11
Include stdio. wps office (1)
Cocos2dを使ったゲーム作成の事例
Ad

Similar to Patrick Kettner - JavaScript without javascript (20)

PDF
Prelude to halide_public
PDF
jacobi method, gauss siedel for solving linear equations
PDF
第13回数学カフェ「素数!!」二次会 LT資料「乱数!!」
DOCX
Include
PPTX
C++ Code as Seen by a Hypercritical Reviewer
DOCX
Current Score – 0 Due Wednesday, November 19 2014 0400 .docx
PPT
Sparse Matrix and Polynomial
PDF
Formulario de Calculo Diferencial-Integral
PDF
2Darrays.pdf. data structure using c programming
PDF
Cryptography and network security record for cse .pdf
PDF
第5回 様々なファイル形式の読み込みとデータの書き出し(解答付き)
PDF
Positive and negative solutions of a boundary value problem for a fractional ...
PDF
令和から本気出す
PDF
Python From Scratch (1).pdf
PDF
Match II (armand)
PDF
Yoyak ScalaDays 2015
PDF
Optimization and Mathematical Programming in R and ROI - R Optimization Infra...
PPTX
10b- Rabin Karp String Matching Problem.pptx
PDF
C programs
Prelude to halide_public
jacobi method, gauss siedel for solving linear equations
第13回数学カフェ「素数!!」二次会 LT資料「乱数!!」
Include
C++ Code as Seen by a Hypercritical Reviewer
Current Score – 0 Due Wednesday, November 19 2014 0400 .docx
Sparse Matrix and Polynomial
Formulario de Calculo Diferencial-Integral
2Darrays.pdf. data structure using c programming
Cryptography and network security record for cse .pdf
第5回 様々なファイル形式の読み込みとデータの書き出し(解答付き)
Positive and negative solutions of a boundary value problem for a fractional ...
令和から本気出す
Python From Scratch (1).pdf
Match II (armand)
Yoyak ScalaDays 2015
Optimization and Mathematical Programming in R and ROI - R Optimization Infra...
10b- Rabin Karp String Matching Problem.pptx
C programs
Ad

More from OdessaJS Conf (20)

PPTX
'GraphQL Schema Design' by Borys Mohyla. OdessaJS'2021
PDF
'How i came up with my talk' by Yurii Artiukh. OdessaJS'2021
PDF
"Is there life in react without redux" by Babich Sergiy. OdessaJS'2021
PPTX
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
PPTX
Андрій Троян. Розробка мікросервісів з NestJS. OdessaJS'2021
PPTX
Олексій Гончар "Використання Electron в розробці корпоративної відео-мессeндж...
PDF
Максим Климишин "Що такого особливого у пропозиції вартості шаблону Micro Fro...
PDF
Павло Галушко. GOOD CODE MYTHS. OdessaJS'2021
PPTX
"NODEJS & GRAPHQL COOKBOOK. LET’S TALK ABOUT MICRO-SERVICES" by Антон Чередні...
PPTX
'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko
PPTX
'IS THERE JAVASCRIPT ON SWAGGER PLUGINS?' by Dmytro Gusev
PPTX
'ETHEREUM SMART CONTRACTS ON JS' by Yaroslav Dvorovenko
PPTX
'GOLANG USAGE IN DEVELOPMENT OF NODE.JS APPLICATIONS (NODE.JS: IN GO WE TRUST...
PPTX
'MICROFRONTENDS WITH REACT' by Liliia Karpenko
PDF
'Web performance metrics' BY ROMAN SAVITSKYI at OdessaJS'2020
PDF
'STORY OF ANOTHER ANIMATION' by YURII ARTYUKH at OdessaJS'2020
PDF
'JavaScript was invented in Odessa' by DMITRIY GUSEV at OdessaJS'2020
PDF
'Why svelte' by BORYS MOHYLA at OdessaJS'2020
PDF
'Effective node.js development' by Viktor Turskyi at OdessaJS'2020
PDF
'Tensorflow.js in real life' by Pavlo Galushko at OdessaJS'2020
'GraphQL Schema Design' by Borys Mohyla. OdessaJS'2021
'How i came up with my talk' by Yurii Artiukh. OdessaJS'2021
"Is there life in react without redux" by Babich Sergiy. OdessaJS'2021
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
Андрій Троян. Розробка мікросервісів з NestJS. OdessaJS'2021
Олексій Гончар "Використання Electron в розробці корпоративної відео-мессeндж...
Максим Климишин "Що такого особливого у пропозиції вартості шаблону Micro Fro...
Павло Галушко. GOOD CODE MYTHS. OdessaJS'2021
"NODEJS & GRAPHQL COOKBOOK. LET’S TALK ABOUT MICRO-SERVICES" by Антон Чередні...
'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko
'IS THERE JAVASCRIPT ON SWAGGER PLUGINS?' by Dmytro Gusev
'ETHEREUM SMART CONTRACTS ON JS' by Yaroslav Dvorovenko
'GOLANG USAGE IN DEVELOPMENT OF NODE.JS APPLICATIONS (NODE.JS: IN GO WE TRUST...
'MICROFRONTENDS WITH REACT' by Liliia Karpenko
'Web performance metrics' BY ROMAN SAVITSKYI at OdessaJS'2020
'STORY OF ANOTHER ANIMATION' by YURII ARTYUKH at OdessaJS'2020
'JavaScript was invented in Odessa' by DMITRIY GUSEV at OdessaJS'2020
'Why svelte' by BORYS MOHYLA at OdessaJS'2020
'Effective node.js development' by Viktor Turskyi at OdessaJS'2020
'Tensorflow.js in real life' by Pavlo Galushko at OdessaJS'2020

Recently uploaded (20)

PPT
Teaching material agriculture food technology
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Electronic commerce courselecture one. Pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Approach and Philosophy of On baking technology
PDF
cuic standard and advanced reporting.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Encapsulation theory and applications.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
sap open course for s4hana steps from ECC to s4
Teaching material agriculture food technology
Advanced methodologies resolving dimensionality complications for autism neur...
Electronic commerce courselecture one. Pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Approach and Philosophy of On baking technology
cuic standard and advanced reporting.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Review of recent advances in non-invasive hemoglobin estimation
Diabetes mellitus diagnosis method based random forest with bat algorithm
MIND Revenue Release Quarter 2 2025 Press Release
MYSQL Presentation for SQL database connectivity
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Reach Out and Touch Someone: Haptics and Empathic Computing
NewMind AI Weekly Chronicles - August'25 Week I
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Encapsulation theory and applications.pdf
The AUB Centre for AI in Media Proposal.docx
sap open course for s4hana steps from ECC to s4

Patrick Kettner - JavaScript without javascript