Join 300,354 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,914 people online right now. Registration is fast and FREE... Join Now!
I suppose that it would be possible -- not really sure one would want to do it though.
The Google Web Toolkit does something similar-ish -- it uses the java syntax to compile to Javascript so that a developer can develop a program that looks like it is Java but rather than targeting the JVM the target platform is javascript and the browser.
IF you were to attempt a javascript JVM I suppose that you would have to start by learning about the JVM - there are a number of good books on the matter and the JVM is open source so you can examine the code (and the comments which are pretty good for the sun product).
I think Najolesor rather wants to translate a .class into a JavaScript I think that if this is the case your teacher won What do you really want to to...
I suppose that it would be possible -- not really sure one would want to do it though.
The Google Web Toolkit does something similar-ish -- it uses the java syntax to compile to Javascript so that a developer can develop a program that looks like it is Java but rather than targeting the JVM the target platform is javascript and the browser.
IF you were to attempt a javascript JVM I suppose that you would have to start by learning about the JVM - there are a number of good books on the matter and the JVM is open source so you can examine the code (and the comments which are pretty good for the sun product).
what books should i find?? can i find it in the net??
QUOTE(pbl @ 3 Jul, 2009 - 01:07 PM)
QUOTE(NickDMax @ 3 Jul, 2009 - 08:22 AM)
Basically to implement a JVM in javascript?
I think Najolesor rather wants to translate a .class into a JavaScript I think that if this is the case your teacher won What do you really want to to...
yes thats it, i want to translate .class into javaScript even my prof doesnt know how to translate it thats why he dares me to decipher it
Basically you could do it... I just found out that JS supports synchronized multithreading, so you could implement monitorenter & monitorexit instructions. Pretty cool that JavaScript. But...what about interfaces, abstract classes, native method descriptors..? Good luck
Basically you could do it... I just found out that JS supports synchronized multithreading, so you could implement monitorenter & monitorexit instructions. Pretty cool that JavaScript. But...what about interfaces, abstract classes, native method descriptors..? Good luck
We are not talking about interfaces, abstract classes, native method descriptors we are talking about their byte code representation Again good luck
And this is a completly theorical exercise there are no practical use for that JavaScript translation
Basically you could do it... I just found out that JS supports synchronized multithreading, so you could implement monitorenter & monitorexit instructions. Pretty cool that JavaScript. But...what about interfaces, abstract classes, native method descriptors..? Good luck
can u teach me how???
QUOTE(pbl @ 6 Jul, 2009 - 05:01 PM)
QUOTE(Gasper @ 6 Jul, 2009 - 11:06 AM)
Basically you could do it... I just found out that JS supports synchronized multithreading, so you could implement monitorenter & monitorexit instructions. Pretty cool that JavaScript. But...what about interfaces, abstract classes, native method descriptors..? Good luck
We are not talking about interfaces, abstract classes, native method descriptors we are talking about their byte code representation Again good luck
And this is a completly theorical exercise there are no practical use for that JavaScript translation
najolesor, the important thing to realise is that your instructor was taking the piss. Rising to the challenge will doubtlessly result in more piss-taking.
Although, if you still want to indulge said piss taking, you could use a decompiler to go from bytecode to Java and then GWT to take that java code and produce JavaScript. A quick shell script or batch file would automate that for you.
However, if you want to do something more productive you could do the dishes or mow the lawn.
From an academic point of view I could see it being a very interesting piece of work. My solution would be quick and easy but I doubt it would yield usable results. A proper solution would be a tonne of work for very little gain.
Maybe you could elaborate on why it would be a useful piece of work. Maybe I'm just short sighted.
What I understood of javaScript, based on my (little) experience with it, is that you can do a lot of things but it is complicated. So yes the main reason for me finding it usefull is that I doesn't have to improve my javaScript skills. And I find java really more "readable" than javaScript. Now that I write it, I found the reason kind of bad but ...
Timetraveling seems to be not useless, tsunami predictive models seems to be not useless at all. Going on the moon seems to be not useless at all. I'll don't workt on any of this topic. Plesase be bitch with me I don't mind