TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Run Python Bytecode in Your Browser

91 pointsby jayfkalmost 10 years ago

4 comments

techdragonalmost 10 years ago
As someone who was at the pycon au sprints watching this come together and hearing Russell talk about the potential uses that motivated him, I&#x27;m excited to see this continue. I&#x27;m hoping to find a little time to try and work on it in the coming week.<p>Pypy.js has demonstrated Python JavaScrip interoperability and DOM integration, so there&#x27;s no reason this project can&#x27;t have similar features. We can ship useful chunks of server side Python to the browser and stop duplicating our efforts.
aldanoralmost 10 years ago
Another way to do this would be to use numba package to generate LLVM IR from Python bytecode (it supports a rich set of instructions including numpy stuff, has type inference, etc), and then run it in the browser via emscripten, with some adjustments to the IR if required.<p>Quick googling yields a related blog post: <a href="http:&#x2F;&#x2F;cyrille.rossant.net&#x2F;numpy-browser-llvm&#x2F;" rel="nofollow">http:&#x2F;&#x2F;cyrille.rossant.net&#x2F;numpy-browser-llvm&#x2F;</a>
评论 #10034881 未加载
smt88almost 10 years ago
The documentation is pretty minimal here, so I&#x27;m wondering if this has anything to do with WebAssembly[1].<p>If not, wouldn&#x27;t it make more sense to target WebAssembly?<p>1. <a href="http:&#x2F;&#x2F;arstechnica.com&#x2F;information-technology&#x2F;2015&#x2F;06&#x2F;the-web-is-getting-its-bytecode-webassembly&#x2F;" rel="nofollow">http:&#x2F;&#x2F;arstechnica.com&#x2F;information-technology&#x2F;2015&#x2F;06&#x2F;the-we...</a>
评论 #10039424 未加载
评论 #10036105 未加载
emerybergeralmost 10 years ago
We (PLASMA @ UMass, <a href="http:&#x2F;&#x2F;plasma.cs.umass.edu" rel="nofollow">http:&#x2F;&#x2F;plasma.cs.umass.edu</a>) have a project with similar aims that is somewhat further along: Ninia (<a href="https:&#x2F;&#x2F;github.com&#x2F;plasma-umass&#x2F;Ninia" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;plasma-umass&#x2F;Ninia</a>). Ninia is a Python bytecode interpreter in TypeScript. It is also being integrated with Doppio, a runtime system for running &quot;conventional&quot; programs inside the browser (<a href="https:&#x2F;&#x2F;github.com&#x2F;plasma-umass&#x2F;doppio" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;plasma-umass&#x2F;doppio</a>), also from our group. DoppioJVM uses Doppio to run JVM bytecode in the browser (<a href="http:&#x2F;&#x2F;www.doppiojvm.org&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.doppiojvm.org&#x2F;</a>). For technical details on both of these, see our PLDI 2014 paper: &quot;Doppio: Breaking the Browser Language Barrier&quot;, by John Vilk (<a href="https:&#x2F;&#x2F;jvilk.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;jvilk.com&#x2F;</a>) and Emery D. Berger (<a href="http:&#x2F;&#x2F;emeryberger.com" rel="nofollow">http:&#x2F;&#x2F;emeryberger.com</a>): <a href="https:&#x2F;&#x2F;dl.acm.org&#x2F;citation.cfm?id=2594293" rel="nofollow">https:&#x2F;&#x2F;dl.acm.org&#x2F;citation.cfm?id=2594293</a> (@ ACM), <a href="http:&#x2F;&#x2F;people.cs.umass.edu&#x2F;~emery&#x2F;pubs&#x2F;doppio.pdf" rel="nofollow">http:&#x2F;&#x2F;people.cs.umass.edu&#x2F;~emery&#x2F;pubs&#x2F;doppio.pdf</a> (non-paywall), video presentation here: <a href="https:&#x2F;&#x2F;vimeo.com&#x2F;106106738" rel="nofollow">https:&#x2F;&#x2F;vimeo.com&#x2F;106106738</a>.<p><i>Abstract:</i><p>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.<p>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&#x2F;O, and multiple threads. We demonstrate Doppio&#x27;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 24× and 42× slower on CPU-intensive benchmarks in Google Chrome), DoppioJVM makes it feasible to directly reuse existing, non compute-intensive code.
评论 #10035966 未加载
评论 #10036113 未加载