SlideShare a Scribd company logo
Java
Java
Motivating Example 
Java Chat Client
Motivating Example 
Java Chat Client 
Features: 
• Connects to multiple chat servers 
• Logs chats to file system 
• 1 thread per server
Motivating Example 
Java Chat Client 
Features: 
• Connects to multiple chat servers 
• Logs chats to file system 
• 1 thread per server
Motivating Example 
Jav 
a
Motivating Example 
Java
Breaking the Browser Language 
Barrier 
1. Key Challenges 
2. Doppio Runtime System 
3. Proof-of-concept: DoppioJVM
Java 
I’m 
dynamic! 
Unsuitable for ahead-of-time compilation
Native VS Browser 
Threads 
Chat Process 
Java 
I’m 
dynamic 
!
Native VS Browser 
Workers (“Processes”) 
Threads 
Chat Process 
Java 
I’m 
dynamic 
!
Workers (“Processes”) 
Java 
I’m 
dynamic 
! 
Native VS Browser 
Threads 
Chat Process 
Hey, 
how’s it 
going? 
Terrible.
Native VS Browser 
TCP Sockets 
Threads 
Chat Process 
Java 
I’m 
dynamic 
!
Native VS Browser TCP Sockets 
WebSockets 
Threads 
Chat Process 
Java 
I’m 
dynamic 
!
Native VS Browser 
File System 
TCP Sockets 
Threads 
Chat Process 
Java 
I’m 
dynamic 
!
Native VS Browser File System 
Persistent Storage 
SQL Database 
TCP Sockets 
Threads 
Chat Process 
Java 
I’m 
dynamic 
! 
Key-value 
(<5MB) 
[localStorage] 
(>5MB) 
[WebSQL] 
Object Database 
(>5MB) 
[IndexedDB] 
“File System” 
(>5MB) 
[HTML5 
FileSystem]
Native Browser Unmanaged VS 
Heap 
TCP Sockets File System 
Threads 
Chat Process 
Java 
I’m 
dynamic 
!
Native Browser Unmanaged VS 
Heap 
Nothing. 
TCP Sockets File System 
Threads 
Chat Process 
Java 
I’m 
dynamic 
!
TCP Sockets File System 
Threads 
Chat Process 
Java 
I’m 
dynamic 
! 
Unmanaged 
Heap
File System 
TCP Sockets 
Threads 
Chat Process 
Java 
I’m 
dynamic 
! 
Unmanaged 
Heap
Challenge #1 
Browser Diversity
Challenge #1 
Browser Diversity
Challenge #1 
Browser Diversity
Browser Diversity Example: 
Storing Chat Client Logs
Browser Diversity Example: 
Storing Chat Client Logs 
Key-value 
(<5MB) 
[localStorage]
Browser Diversity Example: 
Storing Chat Client Logs 
* * 
SQL Database 
(>5MB) 
[WebSQL] 
Key-value 
(<5MB) 
[localStorage] 
* Only for temporary storage
Browser Diversity Example: 
Storing Chat Client Logs 
** 
* * * * 
Object Database 
(>5MB) 
[IndexedDB] 
SQL Database 
(>5MB) 
[WebSQL] 
Key-value 
(<5MB) 
[localStorage] 
* Only for temporary storage ** Partial support
Browser Diversity Example: 
Storing Chat Client Logs 
Key-value 
(<5MB) 
[localStorage] 
** 
Object Database 
(>5MB) 
[IndexedDB] 
* * 
SQL Database 
(>5MB) 
[WebSQL] 
* Only for temporary storage 
* * 
“File System” 
(>5MB) 
[HTML5 
FileSystem] 
** Partial support
Browser Diversity Example: 
Storing Chat Client Logs 
** 
Object Database 
(>5MB) 
[IndexedDB] 
SQL Database 
(>5MB) 
[WebSQL] 
“File System” 
(>5MB) 
[HTML5 
FileSystem] 
* Only for temporary storage ** Partial support
Challenge #2 
Event-Driven Runtime Model
Challenge #2 
Event-Driven Runtime Model
Chat Client PING/PONG
void main(String[] args) { Call Stack 
main 
… 
byte[] response = sendPing(); 
… 
} 
Chat Client PING/PONG in Java
void main(String[] args) { Call Stack 
main 
byte[] sendPing() { 
socket.write(PING); 
socket.read(readBuffer); 
return readBuffer; 
} 
sendPing 
… 
byte[] response = sendPing(); 
… 
} 
Chat Client PING/PONG in Java
Call Stack 
main 
sendPing 
socket.write 
void main(String[] args) { 
… 
byte[] response = sendPing(); 
… 
} 
byte[] sendPing() { 
socket.write(PING); 
socket.read(readBuffer); 
return readBuffer; 
} 
Chat Client PING/PONG in Java
Call Stack 
main 
sendPing 
socket.read 
void main(String[] args) { 
… 
byte[] response = sendPing(); 
… 
} 
byte[] sendPing() { 
socket.write(PING); 
socket.read(readBuffer); 
return readBuffer; 
} 
Chat Client PING/PONG in Java
void main(String[] args) { Call Stack 
main 
sendPing 
… 
byte[] response = sendPing(); 
… 
} 
byte[] sendPing() { 
socket.write(PING); 
socket.read(readBuffer); 
return readBuffer; 
} 
Chat Client PING/PONG in Java
void main(String[] args) { Call Stack 
main 
… 
byte[] response = sendPing(); 
… 
} 
byte[] sendPing() { 
socket.write(PING); 
socket.read(readBuffer); 
return readBuffer; 
} 
Chat Client PING/PONG in Java
Chat Client PING/PONG in JavaScript 
function main() { 
… 
var response = sendPing(); 
… 
} 
Call Stack 
main
Call Stack 
main 
function main() { 
… 
var response = sendPing(); 
… 
} 
Chat Client PING/PONG in JavaScript
Call Stack 
main 
function main() { 
function sendPing() { sendPing 
socket.send(PING); 
socket.onmessage = function(event) 
{ 
// event.data has the PONG 
}; 
??? 
} 
… 
var response = sendPing(); 
… 
} 
Chat Client PING/PONG in JavaScript
Call Stack 
main 
sendPing 
socket.send 
function main() { 
… 
var response = sendPing(); 
… 
} 
function sendPing() { 
socket.send(PING); 
socket.onmessage = function(event) 
{ 
// event.data has the PONG 
}; 
??? 
} 
Chat Client PING/PONG in JavaScript
Call Stack 
main 
sendPing 
function main() { 
… 
var response = sendPing(); 
… 
} 
function sendPing() { 
socket.send(PING); 
socket.onmessage = function(event) 
{ 
// event.data has the PONG 
}; 
??? 
} 
Chat Client PING/PONG in JavaScript
Call Stack 
main 
sendPing 
function main() { 
… 
var response = sendPing(); 
… 
} 
function sendPing() { 
socket.send(PING); 
socket.onmessage = function(event) 
{ 
// event.data has the PONG 
}; 
??? 
} 
Chat Client PING/PONG in JavaScript
Call Stack 
main 
sendPing 
function main() { 
… 
var response = sendPing(); 
… 
} 
function sendPing() { 
socket.send(PING); 
socket.onmessage = function(event) 
{ 
// event.data has the PONG 
}; 
??? 
} 
Chat Client PING/PONG in JavaScript
Call Stack 
main 
function main() { 
function sendPing() { sendPing 
socket.send(PING); 
socket.onmessage = function(event) 
{ 
// event.data has the PONG 
}; 
while(noData) { /* Busy Wait?? */ } 
} 
… 
var response = sendPing(); 
… 
} 
Chat Client PING/PONG in JavaScript
Chat Client PING/PONG in JavaScript 
Call Stack 
main 
sendPing 
function main() { 
… 
var response = sendPing(); 
… 
} 
Browser 
Event Queue 
WebSocket 
message from 
chat server 
function sendPing() { 
socket.send(PING); 
socket.onmessage = function(event) 
{ 
// event.data has the PONG 
}; 
while(noData) { /* Busy Wait?? */ } 
}
Chat Client PING/PONG in JavaScript 
function sendPing() { 
socket.send(PING); 
socket.onmessage = function(event) 
{ 
// event.data has the PONG 
}; 
while(noData) { /* Busy Wait?? */ } 
} 
Call Stack 
main 
sendPing 
function main() { 
… 
var response = sendPing(); 
… 
} 
Browser 
Event Queue 
WebSocket 
message from 
chat server
Chat Client PING/PONG in JavaScript 
Call Stack 
main 
sendPing 
function main() { 
… 
var response = sendPing(); 
… 
} 
Browser 
Event Queue 
WebSocket 
message from 
chat server 
function sendPing() { 
socket.send(PING); 
socket.onmessage = function(event) 
{ 
// event.data has the PONG 
}; 
while(noData) { /* Busy Wait?? */ } 
}
Chat Client PING/PONG in JavaScript 
Call Stack 
main 
function main() { 
function sendPing() { sendPing 
socket.send(PING); 
socket.onmessage = function(event) 
{ 
// event.data has the PONG 
}; 
return; 
} 
… 
var response = sendPing(); 
… 
} 
Browser 
Event Queue 
WebSocket 
message from 
chat server
Call Stack 
main 
function main() { 
… 
var response = sendPing(); 
return; 
} 
Browser 
Event Queue 
WebSocket 
message from 
chat server 
function sendPing() { 
socket.send(PING); 
socket.onmessage = function(event) 
{ 
// event.data has the PONG 
}; 
return; 
} 
Chat Client PING/PONG in JavaScript
Call Stack 
function main() { 
… 
var response = sendPing(); 
return; 
} 
Browser 
Event Queue 
WebSocket 
message from 
chat server 
function sendPing() { 
socket.send(PING); 
socket.onmessage = function(event) 
{ 
// event.data has the PONG 
}; 
return; 
} 
Chat Client PING/PONG in JavaScript
Call Stack 
function main() { 
… 
var response = sendPing(); 
return; 
} 
socket.onmessage 
callback 
Browser 
Event Queue 
function sendPing() { 
socket.send(PING); 
socket.onmessage = function(event) 
{ 
// event.data has the PONG 
}; 
return; 
} 
Chat Client PING/PONG in JavaScript
Chat Client PING/PONG in JavaScript 
function main() { 
… 
var response = sendPing(); 
return; 
} 
function sendPing() { 
socket.send(PING); 
socket.onmessage = function({ 
// event.data has the PONG 
}; 
return; 
} 
void main(String[] args) { 
… 
byte[] response = sendPing(); 
… 
} 
byte[] sendPing() { 
socket.write(PING); 
socket.read(readBuffer); 
return readBuffer; 
}
Breaking the Browser Language 
Barrier 
1. Key Challenges 
2. Doppio Runtime System 
• Doppio Threads 
• Doppio File System 
• Doppio Sockets 
• Doppio Unmanaged Heap 
3. Proof-of-concept: DoppioJVM
Doppio 
100% JavaScript Runtime Library
100% JavaScript Runtime Library 
Doppio 
Threads 
Doppio
100% JavaScript Runtime Library 
Doppio 
TCP Sockets 
Doppio 
File System 
Doppio 
Unmanaged 
Heap 
Doppio 
Threads 
Doppio
Doppio 
Threads 
DoppioJVM 
Proof-of-concept: 100% JavaScript JVM Interpreter 
Doppio 
TCP Sockets 
Doppio 
File System 
Doppio 
Unmanaged 
Heap
Doppio 
Threads 
DoppioJVM 
Proof-of-concept: 100% JavaScript JVM Interpreter 
Doppio 
TCP Sockets 
Doppio 
File System 
Doppio 
Unmanaged 
Heap
Breaking the Browser Language 
Barrier 
1. Key Challenges 
2. Doppio Runtime System 
• Doppio Threads 
• Doppio File System 
• Doppio Sockets 
• Doppio Unmanaged Heap 
3. Proof-of-concept: DoppioJVM
Doppio Threads 
java.lang.Thread
Doppio Threads 
java.lang.Thread 
JavaScript has one thread
Doppio Threads 
java.lang.Thread 
JavaScript has one thread 
?
Doppio Threads 
java.lang.Thread 
JavaScript has one thread 
? 
Doppio 
Thread 
Stack
Doppio Threads 
java.lang.Thread 
JavaScript has one thread 
? 
Doppio 
Thread 
Stack 
✓ Suspend 
✓ Resume
Doppio Threads 
java.lang.Thread 
JavaScript has one thread 
Timesliced priority-based 
scheduling
Doppio Threads 
java.lang.Thread 
JavaScript has one thread 
Timesliced priority-based 
scheduling
Doppio Threads 
java.lang.Thread 
✓ Language threads 
✓ Responsive
Doppio Threads 
java.lang.Thread 
✓ Language threads 
✓ Responsive 
✓ Synchronous I/O
Doppio Threads 
java.lang.Thread 
✓ Language threads 
✓ Responsive 
✓ Synchronous I/O 
Doppio 
Threads
Breaking the Browser Language 
Barrier 
1. Key Challenges 
2. Doppio Runtime System 
• Doppio Threads 
• Doppio File System 
• Doppio Sockets 
• Doppio Unmanaged Heap 
3. Proof-of-concept: DoppioJVM
Doppio File System 
java.io.UnixFileSystem
Doppio File System 
java.io.UnixFileSystem 
Doppio POSIX File 
System Interface
Doppio File System 
Key-value 
[localStorage] 
Object database 
[IndexedDB] 
“File System” 
[HTML5 FileSystem] 
Cloud Storage 
[Dropbox] 
RAM Disk 
Zip Archive 
java.io.UnixFileSystem 
Doppio POSIX File 
System Interface
Doppio File System 
Key-value 
[localStorage] 
Object database 
[IndexedDB] 
“File System” 
[HTML5 FileSystem] 
Cloud Storage 
[Dropbox] 
RAM Disk 
Zip Archive 
java.io.UnixFileSystem 
Doppio POSIX File 
System Interface
Breaking the Browser Language 
Barrier 
1. Key Challenges 
2. Doppio Runtime System 
• Doppio Threads 
• Doppio File System 
• Doppio Sockets 
• Doppio Unmanaged Heap 
3. Proof-of-concept: DoppioJVM
Doppio TCP Sockets 
Natively-running Server 
Server 
TCP connection
Doppio TCP Sockets 
Natively-running Server 
WebSocket connection X 
Server
Doppio TCP Sockets 
Server 
java.net.PlainSocketImpl 
Doppio Sockets 
Natively-running Server 
WebSocket 
Connection 
What’s a 
WebSocket 
?
Doppio TCP Sockets 
Server 
TCP 
connection 
WebSockify 
java.net.PlainSocketImpl 
Doppio Sockets 
Natively-running Server 
WebSocket 
Connection
Breaking the Browser Language 
Barrier 
1. Key Challenges 
2. Doppio Runtime System 
• Doppio Threads 
• Doppio File System 
• Doppio Sockets 
• Doppio Unmanaged Heap 
3. Proof-of-concept: DoppioJVM
Doppio Unmanaged Heap 
sun.misc.Unsafe
Doppio Unmanaged Heap 
Need: 
• malloc 
• free 
sun.misc.Unsafe
Doppio Unmanaged Heap 
Binary Data Representations 
• ArrayBuffer 
• CanvasPixelArray 
• Array of 32-bit ints 
sun.misc.Unsafe
Doppio Unmanaged Heap 
Binary Data Representations 
• ArrayBuffer 
• CanvasPixelArray 
• Array of 32-bit ints 
1:1 
sun.misc.Unsafe
Doppio Unmanaged Heap 
Binary Data Representations 
• ArrayBuffer 
• CanvasPixelArray 
• Array of 32-bit ints 
1:1 
1:2 
sun.misc.Unsafe
Doppio Unmanaged Heap 
Binary Data Representations 
• ArrayBuffer 
• CanvasPixelArray 
• Array of 32-bit ints 
1:1 
1:2 
sun.misc.Unsafe 
Doppio 
Unmanaged 
Heap
Breaking the Browser Language 
Barrier 
1. Key Challenges 
2. Doppio Runtime System 
3. Proof-of-concept: DoppioJVM
DoppioJVM 
OpenJDK Java Class Library 
sun.* 
Packages 
java.* 
Packages 
javax.* 
Packages etc…
DoppioJVM 
sun.misc 
Unsafe 
Doppio 
Unmanaged 
Heap 
java.io 
UnixFileSystem 
Doppio File 
System 
java.net 
PlainSocketImpl 
Doppio Sockets 
java.lang 
Thread 
Doppio 
Threads 
OpenJDK Java Class Library 
sun.* 
Packages 
java.* 
Packages 
javax.* 
Packages etc… 
Doppio OS Services
DoppioJVM 
sun.misc 
Unsafe 
java.io 
UnixFileSystem 
java.net 
PlainSocketImpl 
java.lang 
Thread 
OpenJDK Java Class Library 
sun.* 
Packages 
java.* 
Packages 
javax.* 
Packages etc… 
Java 
Objects 
JavaScript 
Objects 
Most Numeric 
Types 
JavaScript 
Numbers 
Java 
Arrays 
JavaScript 
Arrays 
64-bit 
Integers 
gLong 
Library 
JVM Data Structures
DoppioJVM 
JVM Data Structures For Free 
sun.misc 
Unsafe 
java.io 
UnixFileSystem 
java.net 
PlainSocketImpl 
java.lang 
Thread 
OpenJDK Java Class Library 
sun.* 
Packages 
java.* 
Packages 
javax.* 
Packages etc… 
Java 
Objects 
JavaScript 
Objects 
Most Numeric 
Types 
JavaScript 
Numbers 
Java 
Arrays 
JavaScript 
Arrays 
64-bit 
Integers 
gLong 
Library 
JVM 
GC 
JS 
GC
DoppioJVM 
JVM Data Structures For Free 
OpenJDK Java Class Library 
Java 
Objects 
JavaScript 
Objects 
Most Numeric 
Types 
JavaScript 
Numbers 
Java 
Arrays 
JavaScript 
Arrays 
64-bit 
Integers 
gLong 
Library 
JVM 
GC 
JS 
GC 
Bytecode 
Interpreter 
JVM Features 
ClassLoader Monitors
in Action
in Action
in Action
in Action
in Action
DoppioJVM Native Compatibility 
Runs real, unmodified programs 
* 
• javac (44 KLOC) 
• Java compiler 
• javap (4 KLOC) 
• JVM class file disassembler 
• Kawa-Scheme (121 KLOC) 
• Scheme implementation on the JVM 
• Rhino (57 KLOC) 
• JavaScript implementation on the JVM
DoppioJVM Performance 
* 
* Caused by Safari memory leak: 
https://bugs.webkit.org/show_bug.cgi?id=119049
DoppioJVM: CodeMoo.com
Contributions 
• Doppio: Bridges impedance mismatch 
between conventional languages and 
browser 
• Proof-of-concept: DoppioJVM

More Related Content

What's hot

What you need to remember when you upload to CPAN
What you need to remember when you upload to CPANWhat you need to remember when you upload to CPAN
What you need to remember when you upload to CPAN
charsbar
 
"Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ...
"Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ..."Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ...
"Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ...
Vadym Kazulkin
 
Interactive web. O rly?
Interactive web. O rly?Interactive web. O rly?
Interactive web. O rly?timbc
 
PSGI and Plack from first principles
PSGI and Plack from first principlesPSGI and Plack from first principles
PSGI and Plack from first principles
Perl Careers
 
Developing cacheable PHP applications - Confoo 2018
Developing cacheable PHP applications - Confoo 2018Developing cacheable PHP applications - Confoo 2018
Developing cacheable PHP applications - Confoo 2018
Thijs Feryn
 
LCA2014 - Introduction to Go
LCA2014 - Introduction to GoLCA2014 - Introduction to Go
LCA2014 - Introduction to Go
dreamwidth
 
Gradle in a Polyglot World
Gradle in a Polyglot WorldGradle in a Polyglot World
Gradle in a Polyglot World
Schalk Cronjé
 
Professional Help for PowerShell Modules
Professional Help for PowerShell ModulesProfessional Help for PowerShell Modules
Professional Help for PowerShell Modules
June Blender
 
Open Source XMPP for Cloud Services
Open Source XMPP for Cloud ServicesOpen Source XMPP for Cloud Services
Open Source XMPP for Cloud Services
mattjive
 
HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)
HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)
HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)
Ontico
 
You suck at Memory Analysis
You suck at Memory AnalysisYou suck at Memory Analysis
You suck at Memory Analysis
Francisco Ribeiro
 
G rpc lection1
G rpc lection1G rpc lection1
G rpc lection1
eleksdev
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryTatsuhiko Miyagawa
 
Php go vrooom!
Php go vrooom!Php go vrooom!
Php go vrooom!
Elizabeth Smith
 
[Ruxcon Monthly Sydney 2011] Proprietary Protocols Reverse Engineering : Rese...
[Ruxcon Monthly Sydney 2011] Proprietary Protocols Reverse Engineering : Rese...[Ruxcon Monthly Sydney 2011] Proprietary Protocols Reverse Engineering : Rese...
[Ruxcon Monthly Sydney 2011] Proprietary Protocols Reverse Engineering : Rese...
Moabi.com
 
Powering your website with realtime data
Powering your website with realtime dataPowering your website with realtime data
Powering your website with realtime data
becoded
 
Developing cacheable PHP applications - PHPLimburgBE 2018
Developing cacheable PHP applications - PHPLimburgBE 2018Developing cacheable PHP applications - PHPLimburgBE 2018
Developing cacheable PHP applications - PHPLimburgBE 2018
Thijs Feryn
 
Writing and using php streams and sockets
Writing and using php streams and socketsWriting and using php streams and sockets
Writing and using php streams and sockets
Elizabeth Smith
 
The Real Time Web with XMPP
The Real Time Web with XMPPThe Real Time Web with XMPP
The Real Time Web with XMPP
Jack Moffitt
 

What's hot (20)

What you need to remember when you upload to CPAN
What you need to remember when you upload to CPANWhat you need to remember when you upload to CPAN
What you need to remember when you upload to CPAN
 
"Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ...
"Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ..."Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ...
"Highlights from Java 10&11 and Future of Java" at Java User Group Bonn 2018 ...
 
Interactive web. O rly?
Interactive web. O rly?Interactive web. O rly?
Interactive web. O rly?
 
PSGI and Plack from first principles
PSGI and Plack from first principlesPSGI and Plack from first principles
PSGI and Plack from first principles
 
Developing cacheable PHP applications - Confoo 2018
Developing cacheable PHP applications - Confoo 2018Developing cacheable PHP applications - Confoo 2018
Developing cacheable PHP applications - Confoo 2018
 
LCA2014 - Introduction to Go
LCA2014 - Introduction to GoLCA2014 - Introduction to Go
LCA2014 - Introduction to Go
 
Gradle in a Polyglot World
Gradle in a Polyglot WorldGradle in a Polyglot World
Gradle in a Polyglot World
 
Professional Help for PowerShell Modules
Professional Help for PowerShell ModulesProfessional Help for PowerShell Modules
Professional Help for PowerShell Modules
 
Open Source XMPP for Cloud Services
Open Source XMPP for Cloud ServicesOpen Source XMPP for Cloud Services
Open Source XMPP for Cloud Services
 
Tatsumaki
TatsumakiTatsumaki
Tatsumaki
 
HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)
HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)
HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)
 
You suck at Memory Analysis
You suck at Memory AnalysisYou suck at Memory Analysis
You suck at Memory Analysis
 
G rpc lection1
G rpc lection1G rpc lection1
G rpc lection1
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
 
Php go vrooom!
Php go vrooom!Php go vrooom!
Php go vrooom!
 
[Ruxcon Monthly Sydney 2011] Proprietary Protocols Reverse Engineering : Rese...
[Ruxcon Monthly Sydney 2011] Proprietary Protocols Reverse Engineering : Rese...[Ruxcon Monthly Sydney 2011] Proprietary Protocols Reverse Engineering : Rese...
[Ruxcon Monthly Sydney 2011] Proprietary Protocols Reverse Engineering : Rese...
 
Powering your website with realtime data
Powering your website with realtime dataPowering your website with realtime data
Powering your website with realtime data
 
Developing cacheable PHP applications - PHPLimburgBE 2018
Developing cacheable PHP applications - PHPLimburgBE 2018Developing cacheable PHP applications - PHPLimburgBE 2018
Developing cacheable PHP applications - PHPLimburgBE 2018
 
Writing and using php streams and sockets
Writing and using php streams and socketsWriting and using php streams and sockets
Writing and using php streams and sockets
 
The Real Time Web with XMPP
The Real Time Web with XMPPThe Real Time Web with XMPP
The Real Time Web with XMPP
 

Viewers also liked

Crossing the Language Barrier
Crossing the Language BarrierCrossing the Language Barrier
Crossing the Language Barrier
furnisse
 
Semantic barriers in communication
Semantic barriers in communicationSemantic barriers in communication
Semantic barriers in communication
Tiyas Chowdhury
 
Second language acquisition
Second language acquisitionSecond language acquisition
Second language acquisition
Gibreel Sadeq Alaghbary
 
Non Verbal communication and use of body language expression
Non Verbal communication and use of body language expressionNon Verbal communication and use of body language expression
Non Verbal communication and use of body language expression
Deepak Agarwal
 
Paper Presentation on Problems Related to Global Business due to Cultural Div...
Paper Presentation on Problems Related to Global Business due to Cultural Div...Paper Presentation on Problems Related to Global Business due to Cultural Div...
Paper Presentation on Problems Related to Global Business due to Cultural Div...
Sonali Srivastava
 
Barriers of Communication
Barriers of CommunicationBarriers of Communication
Barriers of Communication
venkatesh yadav
 
Powerpoint communication barriers
Powerpoint communication barriersPowerpoint communication barriers
Powerpoint communication barriersRiza Gomez
 
Barriers to communication
Barriers to communicationBarriers to communication
Barriers to communication
Namrata Jadhav
 

Viewers also liked (8)

Crossing the Language Barrier
Crossing the Language BarrierCrossing the Language Barrier
Crossing the Language Barrier
 
Semantic barriers in communication
Semantic barriers in communicationSemantic barriers in communication
Semantic barriers in communication
 
Second language acquisition
Second language acquisitionSecond language acquisition
Second language acquisition
 
Non Verbal communication and use of body language expression
Non Verbal communication and use of body language expressionNon Verbal communication and use of body language expression
Non Verbal communication and use of body language expression
 
Paper Presentation on Problems Related to Global Business due to Cultural Div...
Paper Presentation on Problems Related to Global Business due to Cultural Div...Paper Presentation on Problems Related to Global Business due to Cultural Div...
Paper Presentation on Problems Related to Global Business due to Cultural Div...
 
Barriers of Communication
Barriers of CommunicationBarriers of Communication
Barriers of Communication
 
Powerpoint communication barriers
Powerpoint communication barriersPowerpoint communication barriers
Powerpoint communication barriers
 
Barriers to communication
Barriers to communicationBarriers to communication
Barriers to communication
 

Similar to Doppio: Breaking the Browser Language Barrier

Real-Time Python Web: Gevent and Socket.io
Real-Time Python Web: Gevent and Socket.ioReal-Time Python Web: Gevent and Socket.io
Real-Time Python Web: Gevent and Socket.ioRick Copeland
 
Rapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devicesRapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devices
ciklum_ods
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSockets
Gonzalo Ayuso
 
Original slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talkOriginal slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talk
Aarti Parikh
 
Plack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversPlack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversTatsuhiko Miyagawa
 
Exploring Kotlin
Exploring KotlinExploring Kotlin
Exploring Kotlin
Atiq Ur Rehman
 
WebTalk - Implementing Web Services with a dedicated Java daemon
WebTalk - Implementing Web Services with a dedicated Java daemonWebTalk - Implementing Web Services with a dedicated Java daemon
WebTalk - Implementing Web Services with a dedicated Java daemon
Geert Van Pamel
 
node.js: Javascript's in your backend
node.js: Javascript's in your backendnode.js: Javascript's in your backend
node.js: Javascript's in your backend
David Padbury
 
Introduction to Vert.x
Introduction to Vert.xIntroduction to Vert.x
Introduction to Vert.x
Yiguang Hu
 
Node.js vs Play Framework (with Japanese subtitles)
Node.js vs Play Framework (with Japanese subtitles)Node.js vs Play Framework (with Japanese subtitles)
Node.js vs Play Framework (with Japanese subtitles)
Yevgeniy Brikman
 
Nodejs Explained with Examples
Nodejs Explained with ExamplesNodejs Explained with Examples
Nodejs Explained with Examples
Gabriele Lana
 
Nodejsexplained 101116115055-phpapp02
Nodejsexplained 101116115055-phpapp02Nodejsexplained 101116115055-phpapp02
Nodejsexplained 101116115055-phpapp02
Sunny Gupta
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.jsRichard Lee
 
Node js
Node jsNode js
Node jshazzaz
 
Modern javascript localization with c-3po and the good old gettext
Modern javascript localization with c-3po and the good old gettextModern javascript localization with c-3po and the good old gettext
Modern javascript localization with c-3po and the good old gettext
Alexander Mostovenko
 
Python, WebRTC and You (v2)
Python, WebRTC and You (v2)Python, WebRTC and You (v2)
Python, WebRTC and You (v2)
Saúl Ibarra Corretgé
 
Nodejs - A quick tour (v6)
Nodejs - A quick tour (v6)Nodejs - A quick tour (v6)
Nodejs - A quick tour (v6)
Felix Geisendörfer
 
Plugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGemsPlugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGems
Sadayuki Furuhashi
 
Apache Beam de A à Z
 Apache Beam de A à Z Apache Beam de A à Z
Apache Beam de A à Z
Paris Data Engineers !
 

Similar to Doppio: Breaking the Browser Language Barrier (20)

Real-Time Python Web: Gevent and Socket.io
Real-Time Python Web: Gevent and Socket.ioReal-Time Python Web: Gevent and Socket.io
Real-Time Python Web: Gevent and Socket.io
 
Rapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devicesRapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devices
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSockets
 
Original slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talkOriginal slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talk
 
About Node.js
About Node.jsAbout Node.js
About Node.js
 
Plack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversPlack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and servers
 
Exploring Kotlin
Exploring KotlinExploring Kotlin
Exploring Kotlin
 
WebTalk - Implementing Web Services with a dedicated Java daemon
WebTalk - Implementing Web Services with a dedicated Java daemonWebTalk - Implementing Web Services with a dedicated Java daemon
WebTalk - Implementing Web Services with a dedicated Java daemon
 
node.js: Javascript's in your backend
node.js: Javascript's in your backendnode.js: Javascript's in your backend
node.js: Javascript's in your backend
 
Introduction to Vert.x
Introduction to Vert.xIntroduction to Vert.x
Introduction to Vert.x
 
Node.js vs Play Framework (with Japanese subtitles)
Node.js vs Play Framework (with Japanese subtitles)Node.js vs Play Framework (with Japanese subtitles)
Node.js vs Play Framework (with Japanese subtitles)
 
Nodejs Explained with Examples
Nodejs Explained with ExamplesNodejs Explained with Examples
Nodejs Explained with Examples
 
Nodejsexplained 101116115055-phpapp02
Nodejsexplained 101116115055-phpapp02Nodejsexplained 101116115055-phpapp02
Nodejsexplained 101116115055-phpapp02
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Node js
Node jsNode js
Node js
 
Modern javascript localization with c-3po and the good old gettext
Modern javascript localization with c-3po and the good old gettextModern javascript localization with c-3po and the good old gettext
Modern javascript localization with c-3po and the good old gettext
 
Python, WebRTC and You (v2)
Python, WebRTC and You (v2)Python, WebRTC and You (v2)
Python, WebRTC and You (v2)
 
Nodejs - A quick tour (v6)
Nodejs - A quick tour (v6)Nodejs - A quick tour (v6)
Nodejs - A quick tour (v6)
 
Plugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGemsPlugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGems
 
Apache Beam de A à Z
 Apache Beam de A à Z Apache Beam de A à Z
Apache Beam de A à Z
 

More from Emery Berger

Dthreads: Efficient Deterministic Multithreading
Dthreads: Efficient Deterministic MultithreadingDthreads: Efficient Deterministic Multithreading
Dthreads: Efficient Deterministic Multithreading
Emery Berger
 
Programming with People
Programming with PeopleProgramming with People
Programming with People
Emery Berger
 
Stabilizer: Statistically Sound Performance Evaluation
Stabilizer: Statistically Sound Performance EvaluationStabilizer: Statistically Sound Performance Evaluation
Stabilizer: Statistically Sound Performance EvaluationEmery Berger
 
DieHarder (CCS 2010, WOOT 2011)
DieHarder (CCS 2010, WOOT 2011)DieHarder (CCS 2010, WOOT 2011)
DieHarder (CCS 2010, WOOT 2011)
Emery Berger
 
Operating Systems - Advanced File Systems
Operating Systems - Advanced File SystemsOperating Systems - Advanced File Systems
Operating Systems - Advanced File SystemsEmery Berger
 
Operating Systems - File Systems
Operating Systems - File SystemsOperating Systems - File Systems
Operating Systems - File Systems
Emery Berger
 
Operating Systems - Networks
Operating Systems - NetworksOperating Systems - Networks
Operating Systems - Networks
Emery Berger
 
Operating Systems - Queuing Systems
Operating Systems - Queuing SystemsOperating Systems - Queuing Systems
Operating Systems - Queuing SystemsEmery Berger
 
Operating Systems - Distributed Parallel Computing
Operating Systems - Distributed Parallel ComputingOperating Systems - Distributed Parallel Computing
Operating Systems - Distributed Parallel ComputingEmery Berger
 
Operating Systems - Concurrency
Operating Systems - ConcurrencyOperating Systems - Concurrency
Operating Systems - ConcurrencyEmery Berger
 
Operating Systems - Advanced Synchronization
Operating Systems - Advanced SynchronizationOperating Systems - Advanced Synchronization
Operating Systems - Advanced SynchronizationEmery Berger
 
Operating Systems - Synchronization
Operating Systems - SynchronizationOperating Systems - Synchronization
Operating Systems - Synchronization
Emery Berger
 
Processes and Threads
Processes and ThreadsProcesses and Threads
Processes and Threads
Emery Berger
 
Virtual Memory and Paging
Virtual Memory and PagingVirtual Memory and Paging
Virtual Memory and Paging
Emery Berger
 
Operating Systems - Virtual Memory
Operating Systems - Virtual MemoryOperating Systems - Virtual Memory
Operating Systems - Virtual Memory
Emery Berger
 
MC2: High-Performance Garbage Collection for Memory-Constrained Environments
MC2: High-Performance Garbage Collection for Memory-Constrained EnvironmentsMC2: High-Performance Garbage Collection for Memory-Constrained Environments
MC2: High-Performance Garbage Collection for Memory-Constrained Environments
Emery Berger
 
Vam: A Locality-Improving Dynamic Memory Allocator
Vam: A Locality-Improving Dynamic Memory AllocatorVam: A Locality-Improving Dynamic Memory Allocator
Vam: A Locality-Improving Dynamic Memory Allocator
Emery Berger
 
Quantifying the Performance of Garbage Collection vs. Explicit Memory Management
Quantifying the Performance of Garbage Collection vs. Explicit Memory ManagementQuantifying the Performance of Garbage Collection vs. Explicit Memory Management
Quantifying the Performance of Garbage Collection vs. Explicit Memory Management
Emery Berger
 
Garbage Collection without Paging
Garbage Collection without PagingGarbage Collection without Paging
Garbage Collection without Paging
Emery Berger
 
DieHard: Probabilistic Memory Safety for Unsafe Languages
DieHard: Probabilistic Memory Safety for Unsafe LanguagesDieHard: Probabilistic Memory Safety for Unsafe Languages
DieHard: Probabilistic Memory Safety for Unsafe Languages
Emery Berger
 

More from Emery Berger (20)

Dthreads: Efficient Deterministic Multithreading
Dthreads: Efficient Deterministic MultithreadingDthreads: Efficient Deterministic Multithreading
Dthreads: Efficient Deterministic Multithreading
 
Programming with People
Programming with PeopleProgramming with People
Programming with People
 
Stabilizer: Statistically Sound Performance Evaluation
Stabilizer: Statistically Sound Performance EvaluationStabilizer: Statistically Sound Performance Evaluation
Stabilizer: Statistically Sound Performance Evaluation
 
DieHarder (CCS 2010, WOOT 2011)
DieHarder (CCS 2010, WOOT 2011)DieHarder (CCS 2010, WOOT 2011)
DieHarder (CCS 2010, WOOT 2011)
 
Operating Systems - Advanced File Systems
Operating Systems - Advanced File SystemsOperating Systems - Advanced File Systems
Operating Systems - Advanced File Systems
 
Operating Systems - File Systems
Operating Systems - File SystemsOperating Systems - File Systems
Operating Systems - File Systems
 
Operating Systems - Networks
Operating Systems - NetworksOperating Systems - Networks
Operating Systems - Networks
 
Operating Systems - Queuing Systems
Operating Systems - Queuing SystemsOperating Systems - Queuing Systems
Operating Systems - Queuing Systems
 
Operating Systems - Distributed Parallel Computing
Operating Systems - Distributed Parallel ComputingOperating Systems - Distributed Parallel Computing
Operating Systems - Distributed Parallel Computing
 
Operating Systems - Concurrency
Operating Systems - ConcurrencyOperating Systems - Concurrency
Operating Systems - Concurrency
 
Operating Systems - Advanced Synchronization
Operating Systems - Advanced SynchronizationOperating Systems - Advanced Synchronization
Operating Systems - Advanced Synchronization
 
Operating Systems - Synchronization
Operating Systems - SynchronizationOperating Systems - Synchronization
Operating Systems - Synchronization
 
Processes and Threads
Processes and ThreadsProcesses and Threads
Processes and Threads
 
Virtual Memory and Paging
Virtual Memory and PagingVirtual Memory and Paging
Virtual Memory and Paging
 
Operating Systems - Virtual Memory
Operating Systems - Virtual MemoryOperating Systems - Virtual Memory
Operating Systems - Virtual Memory
 
MC2: High-Performance Garbage Collection for Memory-Constrained Environments
MC2: High-Performance Garbage Collection for Memory-Constrained EnvironmentsMC2: High-Performance Garbage Collection for Memory-Constrained Environments
MC2: High-Performance Garbage Collection for Memory-Constrained Environments
 
Vam: A Locality-Improving Dynamic Memory Allocator
Vam: A Locality-Improving Dynamic Memory AllocatorVam: A Locality-Improving Dynamic Memory Allocator
Vam: A Locality-Improving Dynamic Memory Allocator
 
Quantifying the Performance of Garbage Collection vs. Explicit Memory Management
Quantifying the Performance of Garbage Collection vs. Explicit Memory ManagementQuantifying the Performance of Garbage Collection vs. Explicit Memory Management
Quantifying the Performance of Garbage Collection vs. Explicit Memory Management
 
Garbage Collection without Paging
Garbage Collection without PagingGarbage Collection without Paging
Garbage Collection without Paging
 
DieHard: Probabilistic Memory Safety for Unsafe Languages
DieHard: Probabilistic Memory Safety for Unsafe LanguagesDieHard: Probabilistic Memory Safety for Unsafe Languages
DieHard: Probabilistic Memory Safety for Unsafe Languages
 

Recently uploaded

How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
Sharepoint Designs
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
NaapbooksPrivateLimi
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
KrzysztofKkol1
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
Jelle | Nordend
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Hivelance Technology
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
Peter Caitens
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 

Recently uploaded (20)

How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 

Doppio: Breaking the Browser Language Barrier

  • 1.
  • 5. Motivating Example Java Chat Client Features: • Connects to multiple chat servers • Logs chats to file system • 1 thread per server
  • 6. Motivating Example Java Chat Client Features: • Connects to multiple chat servers • Logs chats to file system • 1 thread per server
  • 9. Breaking the Browser Language Barrier 1. Key Challenges 2. Doppio Runtime System 3. Proof-of-concept: DoppioJVM
  • 10. Java I’m dynamic! Unsuitable for ahead-of-time compilation
  • 11. Native VS Browser Threads Chat Process Java I’m dynamic !
  • 12. Native VS Browser Workers (“Processes”) Threads Chat Process Java I’m dynamic !
  • 13. Workers (“Processes”) Java I’m dynamic ! Native VS Browser Threads Chat Process Hey, how’s it going? Terrible.
  • 14. Native VS Browser TCP Sockets Threads Chat Process Java I’m dynamic !
  • 15. Native VS Browser TCP Sockets WebSockets Threads Chat Process Java I’m dynamic !
  • 16. Native VS Browser File System TCP Sockets Threads Chat Process Java I’m dynamic !
  • 17. Native VS Browser File System Persistent Storage SQL Database TCP Sockets Threads Chat Process Java I’m dynamic ! Key-value (<5MB) [localStorage] (>5MB) [WebSQL] Object Database (>5MB) [IndexedDB] “File System” (>5MB) [HTML5 FileSystem]
  • 18. Native Browser Unmanaged VS Heap TCP Sockets File System Threads Chat Process Java I’m dynamic !
  • 19. Native Browser Unmanaged VS Heap Nothing. TCP Sockets File System Threads Chat Process Java I’m dynamic !
  • 20. TCP Sockets File System Threads Chat Process Java I’m dynamic ! Unmanaged Heap
  • 21. File System TCP Sockets Threads Chat Process Java I’m dynamic ! Unmanaged Heap
  • 22. Challenge #1 Browser Diversity
  • 23. Challenge #1 Browser Diversity
  • 24. Challenge #1 Browser Diversity
  • 25. Browser Diversity Example: Storing Chat Client Logs
  • 26. Browser Diversity Example: Storing Chat Client Logs Key-value (<5MB) [localStorage]
  • 27. Browser Diversity Example: Storing Chat Client Logs * * SQL Database (>5MB) [WebSQL] Key-value (<5MB) [localStorage] * Only for temporary storage
  • 28. Browser Diversity Example: Storing Chat Client Logs ** * * * * Object Database (>5MB) [IndexedDB] SQL Database (>5MB) [WebSQL] Key-value (<5MB) [localStorage] * Only for temporary storage ** Partial support
  • 29. Browser Diversity Example: Storing Chat Client Logs Key-value (<5MB) [localStorage] ** Object Database (>5MB) [IndexedDB] * * SQL Database (>5MB) [WebSQL] * Only for temporary storage * * “File System” (>5MB) [HTML5 FileSystem] ** Partial support
  • 30. Browser Diversity Example: Storing Chat Client Logs ** Object Database (>5MB) [IndexedDB] SQL Database (>5MB) [WebSQL] “File System” (>5MB) [HTML5 FileSystem] * Only for temporary storage ** Partial support
  • 31. Challenge #2 Event-Driven Runtime Model
  • 32. Challenge #2 Event-Driven Runtime Model
  • 34. void main(String[] args) { Call Stack main … byte[] response = sendPing(); … } Chat Client PING/PONG in Java
  • 35. void main(String[] args) { Call Stack main byte[] sendPing() { socket.write(PING); socket.read(readBuffer); return readBuffer; } sendPing … byte[] response = sendPing(); … } Chat Client PING/PONG in Java
  • 36. Call Stack main sendPing socket.write void main(String[] args) { … byte[] response = sendPing(); … } byte[] sendPing() { socket.write(PING); socket.read(readBuffer); return readBuffer; } Chat Client PING/PONG in Java
  • 37. Call Stack main sendPing socket.read void main(String[] args) { … byte[] response = sendPing(); … } byte[] sendPing() { socket.write(PING); socket.read(readBuffer); return readBuffer; } Chat Client PING/PONG in Java
  • 38. void main(String[] args) { Call Stack main sendPing … byte[] response = sendPing(); … } byte[] sendPing() { socket.write(PING); socket.read(readBuffer); return readBuffer; } Chat Client PING/PONG in Java
  • 39. void main(String[] args) { Call Stack main … byte[] response = sendPing(); … } byte[] sendPing() { socket.write(PING); socket.read(readBuffer); return readBuffer; } Chat Client PING/PONG in Java
  • 40. Chat Client PING/PONG in JavaScript function main() { … var response = sendPing(); … } Call Stack main
  • 41. Call Stack main function main() { … var response = sendPing(); … } Chat Client PING/PONG in JavaScript
  • 42. Call Stack main function main() { function sendPing() { sendPing socket.send(PING); socket.onmessage = function(event) { // event.data has the PONG }; ??? } … var response = sendPing(); … } Chat Client PING/PONG in JavaScript
  • 43. Call Stack main sendPing socket.send function main() { … var response = sendPing(); … } function sendPing() { socket.send(PING); socket.onmessage = function(event) { // event.data has the PONG }; ??? } Chat Client PING/PONG in JavaScript
  • 44. Call Stack main sendPing function main() { … var response = sendPing(); … } function sendPing() { socket.send(PING); socket.onmessage = function(event) { // event.data has the PONG }; ??? } Chat Client PING/PONG in JavaScript
  • 45. Call Stack main sendPing function main() { … var response = sendPing(); … } function sendPing() { socket.send(PING); socket.onmessage = function(event) { // event.data has the PONG }; ??? } Chat Client PING/PONG in JavaScript
  • 46. Call Stack main sendPing function main() { … var response = sendPing(); … } function sendPing() { socket.send(PING); socket.onmessage = function(event) { // event.data has the PONG }; ??? } Chat Client PING/PONG in JavaScript
  • 47. Call Stack main function main() { function sendPing() { sendPing socket.send(PING); socket.onmessage = function(event) { // event.data has the PONG }; while(noData) { /* Busy Wait?? */ } } … var response = sendPing(); … } Chat Client PING/PONG in JavaScript
  • 48. Chat Client PING/PONG in JavaScript Call Stack main sendPing function main() { … var response = sendPing(); … } Browser Event Queue WebSocket message from chat server function sendPing() { socket.send(PING); socket.onmessage = function(event) { // event.data has the PONG }; while(noData) { /* Busy Wait?? */ } }
  • 49. Chat Client PING/PONG in JavaScript function sendPing() { socket.send(PING); socket.onmessage = function(event) { // event.data has the PONG }; while(noData) { /* Busy Wait?? */ } } Call Stack main sendPing function main() { … var response = sendPing(); … } Browser Event Queue WebSocket message from chat server
  • 50. Chat Client PING/PONG in JavaScript Call Stack main sendPing function main() { … var response = sendPing(); … } Browser Event Queue WebSocket message from chat server function sendPing() { socket.send(PING); socket.onmessage = function(event) { // event.data has the PONG }; while(noData) { /* Busy Wait?? */ } }
  • 51. Chat Client PING/PONG in JavaScript Call Stack main function main() { function sendPing() { sendPing socket.send(PING); socket.onmessage = function(event) { // event.data has the PONG }; return; } … var response = sendPing(); … } Browser Event Queue WebSocket message from chat server
  • 52. Call Stack main function main() { … var response = sendPing(); return; } Browser Event Queue WebSocket message from chat server function sendPing() { socket.send(PING); socket.onmessage = function(event) { // event.data has the PONG }; return; } Chat Client PING/PONG in JavaScript
  • 53. Call Stack function main() { … var response = sendPing(); return; } Browser Event Queue WebSocket message from chat server function sendPing() { socket.send(PING); socket.onmessage = function(event) { // event.data has the PONG }; return; } Chat Client PING/PONG in JavaScript
  • 54. Call Stack function main() { … var response = sendPing(); return; } socket.onmessage callback Browser Event Queue function sendPing() { socket.send(PING); socket.onmessage = function(event) { // event.data has the PONG }; return; } Chat Client PING/PONG in JavaScript
  • 55. Chat Client PING/PONG in JavaScript function main() { … var response = sendPing(); return; } function sendPing() { socket.send(PING); socket.onmessage = function({ // event.data has the PONG }; return; } void main(String[] args) { … byte[] response = sendPing(); … } byte[] sendPing() { socket.write(PING); socket.read(readBuffer); return readBuffer; }
  • 56. Breaking the Browser Language Barrier 1. Key Challenges 2. Doppio Runtime System • Doppio Threads • Doppio File System • Doppio Sockets • Doppio Unmanaged Heap 3. Proof-of-concept: DoppioJVM
  • 57. Doppio 100% JavaScript Runtime Library
  • 58. 100% JavaScript Runtime Library Doppio Threads Doppio
  • 59. 100% JavaScript Runtime Library Doppio TCP Sockets Doppio File System Doppio Unmanaged Heap Doppio Threads Doppio
  • 60. Doppio Threads DoppioJVM Proof-of-concept: 100% JavaScript JVM Interpreter Doppio TCP Sockets Doppio File System Doppio Unmanaged Heap
  • 61. Doppio Threads DoppioJVM Proof-of-concept: 100% JavaScript JVM Interpreter Doppio TCP Sockets Doppio File System Doppio Unmanaged Heap
  • 62. Breaking the Browser Language Barrier 1. Key Challenges 2. Doppio Runtime System • Doppio Threads • Doppio File System • Doppio Sockets • Doppio Unmanaged Heap 3. Proof-of-concept: DoppioJVM
  • 64. Doppio Threads java.lang.Thread JavaScript has one thread
  • 65. Doppio Threads java.lang.Thread JavaScript has one thread ?
  • 66. Doppio Threads java.lang.Thread JavaScript has one thread ? Doppio Thread Stack
  • 67. Doppio Threads java.lang.Thread JavaScript has one thread ? Doppio Thread Stack ✓ Suspend ✓ Resume
  • 68. Doppio Threads java.lang.Thread JavaScript has one thread Timesliced priority-based scheduling
  • 69. Doppio Threads java.lang.Thread JavaScript has one thread Timesliced priority-based scheduling
  • 70. Doppio Threads java.lang.Thread ✓ Language threads ✓ Responsive
  • 71. Doppio Threads java.lang.Thread ✓ Language threads ✓ Responsive ✓ Synchronous I/O
  • 72. Doppio Threads java.lang.Thread ✓ Language threads ✓ Responsive ✓ Synchronous I/O Doppio Threads
  • 73. Breaking the Browser Language Barrier 1. Key Challenges 2. Doppio Runtime System • Doppio Threads • Doppio File System • Doppio Sockets • Doppio Unmanaged Heap 3. Proof-of-concept: DoppioJVM
  • 74. Doppio File System java.io.UnixFileSystem
  • 75. Doppio File System java.io.UnixFileSystem Doppio POSIX File System Interface
  • 76. Doppio File System Key-value [localStorage] Object database [IndexedDB] “File System” [HTML5 FileSystem] Cloud Storage [Dropbox] RAM Disk Zip Archive java.io.UnixFileSystem Doppio POSIX File System Interface
  • 77. Doppio File System Key-value [localStorage] Object database [IndexedDB] “File System” [HTML5 FileSystem] Cloud Storage [Dropbox] RAM Disk Zip Archive java.io.UnixFileSystem Doppio POSIX File System Interface
  • 78. Breaking the Browser Language Barrier 1. Key Challenges 2. Doppio Runtime System • Doppio Threads • Doppio File System • Doppio Sockets • Doppio Unmanaged Heap 3. Proof-of-concept: DoppioJVM
  • 79. Doppio TCP Sockets Natively-running Server Server TCP connection
  • 80. Doppio TCP Sockets Natively-running Server WebSocket connection X Server
  • 81. Doppio TCP Sockets Server java.net.PlainSocketImpl Doppio Sockets Natively-running Server WebSocket Connection What’s a WebSocket ?
  • 82. Doppio TCP Sockets Server TCP connection WebSockify java.net.PlainSocketImpl Doppio Sockets Natively-running Server WebSocket Connection
  • 83. Breaking the Browser Language Barrier 1. Key Challenges 2. Doppio Runtime System • Doppio Threads • Doppio File System • Doppio Sockets • Doppio Unmanaged Heap 3. Proof-of-concept: DoppioJVM
  • 84. Doppio Unmanaged Heap sun.misc.Unsafe
  • 85. Doppio Unmanaged Heap Need: • malloc • free sun.misc.Unsafe
  • 86. Doppio Unmanaged Heap Binary Data Representations • ArrayBuffer • CanvasPixelArray • Array of 32-bit ints sun.misc.Unsafe
  • 87. Doppio Unmanaged Heap Binary Data Representations • ArrayBuffer • CanvasPixelArray • Array of 32-bit ints 1:1 sun.misc.Unsafe
  • 88. Doppio Unmanaged Heap Binary Data Representations • ArrayBuffer • CanvasPixelArray • Array of 32-bit ints 1:1 1:2 sun.misc.Unsafe
  • 89. Doppio Unmanaged Heap Binary Data Representations • ArrayBuffer • CanvasPixelArray • Array of 32-bit ints 1:1 1:2 sun.misc.Unsafe Doppio Unmanaged Heap
  • 90. Breaking the Browser Language Barrier 1. Key Challenges 2. Doppio Runtime System 3. Proof-of-concept: DoppioJVM
  • 91. DoppioJVM OpenJDK Java Class Library sun.* Packages java.* Packages javax.* Packages etc…
  • 92. DoppioJVM sun.misc Unsafe Doppio Unmanaged Heap java.io UnixFileSystem Doppio File System java.net PlainSocketImpl Doppio Sockets java.lang Thread Doppio Threads OpenJDK Java Class Library sun.* Packages java.* Packages javax.* Packages etc… Doppio OS Services
  • 93. DoppioJVM sun.misc Unsafe java.io UnixFileSystem java.net PlainSocketImpl java.lang Thread OpenJDK Java Class Library sun.* Packages java.* Packages javax.* Packages etc… Java Objects JavaScript Objects Most Numeric Types JavaScript Numbers Java Arrays JavaScript Arrays 64-bit Integers gLong Library JVM Data Structures
  • 94. DoppioJVM JVM Data Structures For Free sun.misc Unsafe java.io UnixFileSystem java.net PlainSocketImpl java.lang Thread OpenJDK Java Class Library sun.* Packages java.* Packages javax.* Packages etc… Java Objects JavaScript Objects Most Numeric Types JavaScript Numbers Java Arrays JavaScript Arrays 64-bit Integers gLong Library JVM GC JS GC
  • 95. DoppioJVM JVM Data Structures For Free OpenJDK Java Class Library Java Objects JavaScript Objects Most Numeric Types JavaScript Numbers Java Arrays JavaScript Arrays 64-bit Integers gLong Library JVM GC JS GC Bytecode Interpreter JVM Features ClassLoader Monitors
  • 101. DoppioJVM Native Compatibility Runs real, unmodified programs * • javac (44 KLOC) • Java compiler • javap (4 KLOC) • JVM class file disassembler • Kawa-Scheme (121 KLOC) • Scheme implementation on the JVM • Rhino (57 KLOC) • JavaScript implementation on the JVM
  • 102. DoppioJVM Performance * * Caused by Safari memory leak: https://bugs.webkit.org/show_bug.cgi?id=119049
  • 104. Contributions • Doppio: Bridges impedance mismatch between conventional languages and browser • Proof-of-concept: DoppioJVM

Editor's Notes

  1. Many programming languages, e.g. Java, Python, Ruby — just three examples. Lots of useful programs and libraries
  2. Unfortunately, only one language that runs across all browsers: JavaScript. Wouldn’t it be nice if we could take existing well-tested programs & libraries, and run them in the browser with no modifications?
  3. To motivate the problem: nonexistent text chat client in Java. Illustrates challenges of bringing conventional languages & their programs to browser.
  4. Chat client lets you connect to multiple chat servers at once, logs chats as text files, and encapsulates server connection in its own thread. Goal: take this Java chat client
  5. and run in browser. How?
  6. Compile Java source code of chat client into JavaScript?
  7. Unfortunately, infeasible for variety of reasons.
  8. Why? Key challenges.
  9. First problem: nature of Java itself. Java = dynamic language. Performing AOTcompilation on Java code rules out dynamic class loading, + many parts of the Java reflection API.
  10. Second problem more fundamental. Chat client uses multiple threads, all in same address space.
  11. JavaScript does not support threads. Instead: workers. These workers do not share same address space => cannot share memory with one another.
  12. Instead, communicate by sending messages. Thus, cannot simply map threads to workers — posing challenge to bringing chat client to web.
  13. Chat client uses TCP sockets to communicate with chat servers.
  14. But browser does not support TCP sockets. Instead: WebSockets, protocol implemented on top of TCP => chat client can’t communicate with chat servers, which expect regular TCP connections.
  15. To log chats, the chat client writes text files to file system.
  16. Browser doesn’t have file system. Instead, variety of other mechanisms for storing data, unevenly supported across browsers + variety of restrictions. One uses file system abstraction, but asynchronous & does not support blocking ops. More on that later.
  17. Unbeknownst to chat program, Java Class Library performs # of unsafe operations with explicit memory allocation, requiring unmanaged heap.
  18. Browser does not offer mechanism for explicit memory allocation. Not necessarily bad. Just not there.
  19. Chat client needs all these components to function properly.
  20. To run chat client in browser, we need to somehow emulate all these resources in browser.
  21. Challenge: browser diversity. Not just trying to bring chat client to one browser.
  22. Trying to bring to multiple browsers — unevenly implement various web standards. But not just one version of each browser.
  23. Multiple major versions in use. Not to mention desktop, tablet, & mobile diffs. Browser diversity —> major obstacle to bringing the resources chat client needs into browser. Let’s illustrate with example.
  24. Ignore version differences, and focus on latest version of each browser. As mentioned earlier, chat client needs to write log files into FS. # persistent storage mechanisms in browser that could use to emulate FS.
  25. All implement key-value store that gives programs GIGANTIC 5 MB of storage.
  26. Safari lets web pages store more data in SQL DB. Chrome and Opera offer same functionality, but don’t persist DB… :(
  27. Firefox and IE: web pages can persist data in object DB. Once again, Chrome & Opera don’t persist DB. IE’s implementation - also not fully spec-compliant. SURPRISE
  28. Finally, HTML5 FS. Only Chrome and Opera support this interface. Takeaway = if chat client wants to persist > 5 MB of logs in browser AND cares about browser compatibility,
  29. then must support three completely different storage interfaces. PITA
  30. Second complication stems from JS event-driven runtime model => pervasive asynchrony in JS code.
  31. In particular, JS I/O requires callbacks: painful for bringing conventional languages to browser.
  32. Walk through example: Chat client periodically sends PING to server to ensure connection alive, waits for PONG. Walk through Java, then try to directly translate to JS.
  33. Say, somewhere in main method, chat client fires off ping.
  34. sendPing function might look like this. Simplifying for presentation purposes.
  35. First, chat client writes PING command on socket to server.
  36. Then, blocking read to wait for response.
  37. Finally, returns data read off of wire.
  38. And chat client continues on merry way.
  39. Now, same thing in JS.
  40. Like before, main function calls sendPing.
  41. sendPing sends ping command on WebSocket (like before)
  42. Then, need to assign callback function on socket obj., which browser will call once gets data from chat server. But: problem.
  43. main function expects sendPing returns response from server. But sendPing does not have response yet; must wait for browser to call callback just registered.
  44. Now what? What do we do to return value main expects? JS: no sleep function to suspend execution & persist activation records for sendPing and main.
  45. Busy-wait? server does send WebSocket message to the browser…
  46. …ends up in browser event queue, which program has no access to. This q = mouse clicks, timer fires, and other events while JS executing. PLUS, if try to busy wait,
  47. …browser will kill script, because blocking progress. JS programs have no choice! must execute in CPS, periodically yield to browser event queue, scheduling next phase as new event.
  48. Only way to unblock browser event queue & receive WebSocket message from server = empty JS call stack
  49. So: sendPing returns
  50. and main returns
  51. Now, JS call stack empty Browser fires next event
  52. which triggers callback. But now - completely disrupted program.
  53. To port this Java code to JS: program needs to be completely restructured into CPS to allow breaks in execution for callbacks to execute.
  54. OK, challenges. Now, how Doppio Runtime System overcomes them.
  55. Doppio = 100% JS runtime library for bringing conventional languages to the web.
  56. We implement threads on top of JS’s event-driven runtime model. Language implementations use these threads: (1) keep programs responsive, (2) support synchronous I/O, (3) run multithreaded programs.
  57. Expose TCP socket interface on top of WebSockets, FS interface on top of various storage mechanisms available to the browser, and emulate unmanaged heap. These 3 services handle challenges of browser diversity - programs running in Doppio work across all major browsers.
  58. Using Doppio, we implement DoppioJVM; proof-of-concept JVM interpreter written in 100% JavaScript (TypeScript) can run unmodified programs straight from JAR files.
  59. DoppioJVM contains all features required to bring chat client to web.
  60. Doppio’s threads:
  61. Mentioned before: chat client encapsulates each server connection into own thread.
  62. Problem in browser because JS only has 1 thread.
  63. How to map multiple language-level threads onto one hardware thread?
  64. Doppio Threads - language implementations must explicitly maintain their stack state.
  65. Doppio Threads can then suspend execution by saving stack information into JS object, resume later using saved stack.
  66. build time sliced priority-based thread scheduler adjusts quanta dynamically for responsiveness. = support MT programs w/ preemptive semantics & long-running threads spanning multiple quanta,
  67. prevents freezing web page + keeps application responsive to I/O.
  68. But wait, there’s more!
  69. Can also support synchronous I/O by suspending threads when use JS asynchronous I/O, Resuming once needed information arrives
  70. Now, can hook up JVM threads to Doppio Threads. Chat client can spawn and run across multiple threads w/o needing to be modified.
  71. Now Doppio FS.
  72. Recall: chat client writes files to FS, normally implemented in UnixFileSystem class.
  73. The Doppio FS exposes POSIX FS interface in JavaScript.
  74. FS supports many backends most persistent storage mechanisms mentioned earlier Dropbox cloud storage zip files
  75. Can be mounted into arbitrary locations in Doppio DS dir. hierarchy = great flexibility for where chat client writes log files.
  76. On to network sockets.
  77. chat client expects to connect to chat server via TCP BUT - problem porting to browser…
  78. …no raw access to TCP Instead, WebSockets Server - no idea how to handle WebSocket conn.
  79. Using Doppio Threads, implement JVM’s synch socket abstraction on asynch JS WebSockets. But server - still no idea what WebSocket connection is.
  80. Fix with “WebSockify” Wraps server, transparently proxies WS connections to server as standard TCP connection. = no modification to client or server
  81. Last = unmanaged heap.
  82. @ chat client startup - pulls in LOTS of libraries in Java Class Library Some invoke Unsafe Java API when statically initializing needed to do lots of stuff support = required for running client in browser
  83. Back to my old friends malloc and free. Trust me, I know how to do this efficiently. Must operate on buffers of memory.
  84. Representing binary data efficiently across browsers - tricky! 3 different representations, depending on browser:
  85. ArrayBuffer and predecessor, CanvasPixelArray: guaranteed to compactly represent heap in memory. HTML5 Canvas - CanvasPixelArray used to back img info written to canvas. We abuse it for its compact mem. representation.
  86. Browser doesn’t support these? Fall back to vanilla JS array of #s. 2X memory overhead - JS #s = 64-bit doubles. But: best universal fallback, since all JS bit ops coerce #s into 32-bit form.
  87. Now, implement Doppio’s Unmanaged Heap using these data structures implement the JVM’s malloc and free on top => JCL can perform its unsafe voodoo @ startup
  88. Now, proof of concept, DoppioJVM.
  89. DoppioJVM - unmodified copy of the OpenJDK JCL Provides apps with library support they expect.
  90. Map core JCL interfaces w/ Doppio OS services. Doppio Threads => interfaces keep blocking JVM semantics, even to invoke asynch JS Also - implement native portions of other classes, omitted here
  91. More fundamental details! map core JVM data structures to JS features straightforwardly Java Objects -> JS objects Java Arrays -> JS arrays Most numeric types -> JS numbers - act both as 32-bit integers and 64-bit doubles. 64-bit ints not natively provided in browser - emulate using Google’s gLong library.
  92. This mapping -> GC ‘for free’ because already executing in GC’d environment.
  93. Finally, some features of JVM that we had to simply reimplement. This includes the core bytecode interpreter for JVM bytecodes, the JVM classloader, and JVM monitors, which are used for synchronization across JVM threads.
  94. DoppioJVM is real, it exists, and it has been evaluated by the artifact evaluation committee. This is our mock Terminal interface, which you can check out at doppiojvm.org.
  95. First, I edit a file called Test.java, and I write a variant of the popular Hello World program.
  96. I run an unmodified copy of javac on the Java source, which is now in the Doppio File System, and it compiles it into a class file.
  97. Then, I run this class file, which produces the expected result: Hello, PLDI!
  98. And just for fun, I run the unmodified Java disassembler on the class file, which displays the public methods of the class.
  99. DoppioJVM runs many large, real, unmodified programs. For example, it can run the official Java compiler and disassembler, it can run an implementation of Scheme, and, yes, it can run an implementation of JavaScript. It can run many other programs as well, but we benchmarked DoppioJVM using these programs.
  100. We compare DoppioJVM’s performance to the HotSpot interpreter, because DoppioJVM is an interpreter as well. But we note that DoppioJVM is an untuned proof-of-concept, whereas HotSpot is a highly-optimized native interpreter. Despite this, DoppioJVM is 24 to 42 times slower than the HotSpot interpreter in Google Chrome. While there is a significant difference in DoppioJVM’s performance in Chrome over other browsers, we note that we developed DoppioJVM in Chrome, so that likely biased our results. And as DoppioJVM is an interpreter, any gain in performance in core interpreter loops can significantly improve program runtime. A side note: we found a memory leak in Safari while developing this work, which has since been fixed. In any case, these results are from compute-intensive code. Browsers don’t generally run compute-intensive code, so DoppioJVM is fast enough for many people already.
  101. For example, the University of Illinois launched a website, CodeMoo.com, that uses DoppioJVM to teach children how to program in Java using interactive games. In this basic ‘Level 1’ game, children string together function calls to guide the character in red to the goal without bumping into bad guys. When ready, the child clicks the green button, [HIT SPACE] and watches the character carry out the instructed actions. Under-the-covers, these instructions are placed into a Java file, compiled with the Eclipse Compiler running in DoppioJVM, and then the resulting class file is run in DoppioJVM — all harnessing the power of the visitor’s own browser.
  102. So, in this talk, I introduced Doppio, a full runtime system that bridges the impedance mismatch between conventional languages in the browser. I also introduced our proof-of-concept Java Virtual Machine, DoppioJVM, which can run unmodified Java programs in the browser. I encourage you to check out Doppio at DoppioJVM.org. Thank you for your attention.