Live data from Hacker News

DoppioVM: a JVM in CoffeeScript

int3.github.com

11–20 of 32 posts

Re: DoppioVM: a JVM in CoffeeScript

#11
Funny enough, Someone had told me about a grad student having to recreate the JVM in JavaScript at our school. Low and behold, the credits at the bottom of the page are for a few grad students at my school.

I think its a silly thing really, running a JVM on top of a JITer inside a browser. I can see it having some uses in specific cases but I can't imagine it being used for anything heavy duty.

Re: DoppioVM: a JVM in CoffeeScript

#12
post #3

Talk about abstraction! Java -> bytecode -> JVM -> CoffeeScript -> JavaScript -> interpreter/JIT -> machine code -> CPU -> hardware. Turtles all the way down...

I don't think the CoffeeScript step exists in the pipeline. CoffeeScript is the language the JVM is written in, but I don't expect it outputs CoffeeScript itself.

From a purely abstraction perspective that step makes sense. However it would be omitted if we were talking about a run time stack.

Re: DoppioVM: a JVM in CoffeeScript

#13
post #7
post #2

I'm one of the authors. Doppio's not the first JVM in Javascript, but I believe we have the most extensive support for the JRE among the lot. In particular, we can run Rhino and the Java 4 compiler. Feel free to ask me any questions! Check out the demo here: http://int3.github.com/doppio/

Can you run Doppio in Rhino on the JVM?

I don't personally like memes on HN but I believe this qualifies a "yo dawg".

Re: DoppioVM: a JVM in CoffeeScript

#14

Funny enough, Someone had told me about a grad student having to recreate the JVM in JavaScript at our school. Low and behold, the credits at the bottom of the page are for a few grad students at my school. I think its a silly thing really, running a JVM on top of a JITer inside a browser. I can see it having some uses in specific cases but I can't imagine it being used for anything heavy duty.

Indeed, it started out as a class project, but we're hoping to take it a lot further.

The plan is to implement a bytecode -> JS compiler next, a la JSIL / Emscripten. Thus far most of the work has gone into porting the runtime environment first.

P.S. I'm a sophomore, the other two are grad students :)

Re: DoppioVM: a JVM in CoffeeScript

#15

Funny enough, Someone had told me about a grad student having to recreate the JVM in JavaScript at our school. Low and behold, the credits at the bottom of the page are for a few grad students at my school. I think its a silly thing really, running a JVM on top of a JITer inside a browser. I can see it having some uses in specific cases but I can't imagine it being used for anything heavy duty.

[deleted]

Re: DoppioVM: a JVM in CoffeeScript

#16
I'm particularly impressed by this:

> While we do not emulate threads, we still wanted to handle blocking operations, particularly for standard input. Since the browser DOM is largely asynchronous, blocking operations have to be emulated via async callbacks. We solved this by implementing a 'yield' construct: upon encountering a blocking function, we throw a YieldException to pause the VM. This exception would also contain the asynchronous function that we are waiting on, which eventually calls the VM and resumes the program.

Absolutely brilliant work guys

Re: DoppioVM: a JVM in CoffeeScript

#17

Funny enough, Someone had told me about a grad student having to recreate the JVM in JavaScript at our school. Low and behold, the credits at the bottom of the page are for a few grad students at my school. I think its a silly thing really, running a JVM on top of a JITer inside a browser. I can see it having some uses in specific cases but I can't imagine it being used for anything heavy duty.

It might be useful 5 years from now. There was another story a few weeks ago about Mozilla implementing a JavaScript interpreter inside JavaScript itself for security and sandboxing. This could lead to same thing. Although it's literally 100 to 200 thousand times slower than native code right now, but that might not be a big problem a few years from now (in the next few years we will probably see a huge increase of attention towards web app security).

Oh, and if this thing catches on, we won't be seeing another FlashBlock again :)

Re: DoppioVM: a JVM in CoffeeScript

#18
We had browser sniffing, now we have jQuery sniffing :(

    function scrollToBottom() {
        jQuery.fn.jquery > "1.6" ? 
          inner.prop({scrollTop: inner.prop("scrollHeight")}) : 
          inner.attr({scrollTop: inner.attr("scrollHeight")})
    }
Post reply on HN