Abstract
Web browsers have become a de facto universal operating system, and JavaScript its instruction set. Unfortunately, running other languages in the browser is not generally possible. Translation to JavaScript is not enough because browsers are a hostile environment for other languages. Previous approaches are either non-portable or require extensive modifications for programs to work in a browser.
This paper presents Doppio, a JavaScript-based runtime system that makes it possible to run unaltered applications written in general-purpose languages directly inside the browser. Doppio provides a wide range of runtime services, including a file system that enables local and external (cloud-based) storage, an unmanaged heap, sockets, blocking I/O, and multiple threads. We demonstrate DOPPIO's usefulness with two case studies: we extend Emscripten with Doppio, letting it run an unmodified C++ application in the browser with full functionality, and present DoppioJVM, an interpreter that runs unmodified JVM programs directly in the browser. While substantially slower than a native JVM (between 24X and 42X slower on CPU-intensive benchmarks in Google Chrome), DoppioJVM makes it feasible to directly reuse existing, non compute-intensive code.
- A. Adya, J. Howell, M. Theimer, W. J. Bolosky, and J. R. Douceur. Cooperative task management without manual stack management. In USENIX Annual Technical Conference, General Track, pages 289--302, 2002. Google Scholar
Digital Library
- J. Ansel, P. Marchenko, Ú. Erlingsson, E. Taylor, B. Chen, D. L. Schuff, D. Sehr, C. Biffle, and B. Yee. Language-independent sandboxing of just-in-time compilation and self-modifying code. In M. W. Hall and D. A. Padua, editors, PLDI, pages 355--366. ACM, 2011. Google Scholar
Digital Library
- P. Bright. Internet Explorer 10 share doubles again on the back of Windows 7. http://goo.gl/hLYPa5.Google Scholar
- David Herman and Luke Wagner and Alon Zakai. asm.js. http://asmjs.org/spec/latest/.Google Scholar
- J. R. Douceur, J. Elson, J. Howell, and J. R. Lorch. Leveraging legacy code to deploy desktop applications on the web. In R. Draves and R. van Renesse, editors, OSDI, pages 339--354. USENIX Association, 2008. Google Scholar
Digital Library
- C. Fournet, N. Swamy, J. Chen, P.-É. Dagand, P.-Y. Strub, and B. Livshits. Fully abstract compilation to JavaScript. In POPL, pages 371--384, 2013. Google Scholar
Digital Library
- Google. Dart: Structured web apps. http://www.dartlang.org/.Google Scholar
- Google. JRE Emulation Reference - Google Web Toolkit - Google Developers. https://developers.google.com/web-toolkit/doc/latest/RefJreEmulation.Google Scholar
- Google. NaCl and PNaCl. https://developers.google.com/native-client/pnacl-preview/nacl-and-pnacl.Google Scholar
- Google. WebRTC. http://www.webrtc.org/.Google Scholar
- Google Web Toolkit Community. Google web toolkit. https://developers.google.com/web-toolkit/.Google Scholar
- A. Guha, C. Saftoiu, and S. Krishnamurthi. The essence of JavaScript. In ECOOP, pages 126--150, 2010. Google Scholar
Digital Library
- Jeremy Ashkenas. CoffeeScript. http://coffeescript.org/.Google Scholar
- Khronos Group. WebGL - OpenGL ES 2.0 for the Web. http://www.khronos.org/webgl/.Google Scholar
- T. Lindholm and F. Yellin. The Java virtual machine specification. Java series. Addison-Wesley, 1999. Google Scholar
Digital Library
- J. Martin. kanaka/websockify. https://github.com/kanaka/websockify.Google Scholar
- Microsoft Corporation. IL2JS - an intermediate language to JavaScript compiler. https://github.com/Reactive-Extensions/IL2JS.Google Scholar
- Microsoft Corporation. setImmediate API. http://ie.microsoft.com/testdrive/Performance/setImmediateSorting/Default.html.Google Scholar
- Microsoft Corporation. Welcome to TypeScript. http://www.typescriptlang.org.Google Scholar
- R. Sasse, S. T. King, J. Meseguer, and S. Tang. Ibos: A correct-by-construction modular browser. In C. S. Pasareanu and G. Salaün, editors, FACS, volume 7684 of Lecture Notes in Computer Science, pages 224--241. Springer, 2012.Google Scholar
- University of Illinois. Code Moo -- A playful way to learn programming. http://www.codemoo.com/index2.html.Google Scholar
- W3C Working Group. 6. Web application APIs. http://www.w3.org/TR/html5/webappapis.html#timers.Google Scholar
- B. Yee, D. Sehr, G. Dardyk, J. B. Chen, R. Muth, T. Ormandy, S. Okasaka, N. Narula, and N. Fullagar. Native client: a sandbox for portable, untrusted x86 native code. Commun. ACM, 53(1):91--99, 2010. Google Scholar
Digital Library
- D. Yoo, E. Schanzer, S. Krishnamurthi, and K. Fisler. Wescheme: the browser is your programming environment. In G. Rößling, T. L. Naps, and C. Spannagel, editors, ITiCSE, pages 163--167. ACM, 2011. Google Scholar
Digital Library
- A. Zakai. Porting "Me & My Shadow" to the Web. http://mzl.la/17Mujzr.Google Scholar
- A. Zakai. Emscripten: an LLVM-to-JavaScript compiler. In OOPSLA Companion, pages 301--312, 2011. Google Scholar
Digital Library
Index Terms
Doppio: breaking the browser language barrier
Recommendations
Doppio: breaking the browser language barrier
PLDI '14: Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and ImplementationWeb browsers have become a de facto universal operating system, and JavaScript its instruction set. Unfortunately, running other languages in the browser is not generally possible. Translation to JavaScript is not enough because browsers are a hostile ...
Whalesong: running racket in the browser
DLS '13JavaScript is the language of the ubiquitous Web, but it only poorly supports event-driven functional programs due to its single-threaded, asynchronous nature and lack of rich control flow operators. We present Whalesong, a compiler from Racket that ...
Whalesong: running racket in the browser
DLS '13: Proceedings of the 9th symposium on Dynamic languagesJavaScript is the language of the ubiquitous Web, but it only poorly supports event-driven functional programs due to its single-threaded, asynchronous nature and lack of rich control flow operators. We present Whalesong, a compiler from Racket that ...







Comments