Java School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a Java Expert!

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!




decipher java language

 

decipher java language, how to decipher

najolesor

3 Jul, 2009 - 07:09 AM
Post #1

New D.I.C Head
*

Joined: 24 Jan, 2009
Posts: 4


My Contributions
my prof dares me to decipher java machine language to java script

is anyone there knows about it and let me know

i want to learn

This post has been edited by pbl: 18 Jul, 2009 - 09:20 PM

User is offlineProfile CardPM
+Quote Post


NickDMax

RE: Decipher Java Language

3 Jul, 2009 - 08:22 AM
Post #2

Can grep dead trees!
Group Icon

Joined: 18 Feb, 2007
Posts: 5,216



Thanked: 285 times
Dream Kudos: 1175
Expert In: Java/C++

My Contributions
Basically to implement a JVM in javascript?

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).
User is online!Profile CardPM
+Quote Post

pbl

RE: Decipher Java Language

3 Jul, 2009 - 01:07 PM
Post #3

Java Lover
Group Icon

Joined: 6 Mar, 2008
Posts: 9,533



Thanked: 1124 times
Dream Kudos: 450
My Contributions
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 smile.gif
What do you really want to to...

User is offlineProfile CardPM
+Quote Post

najolesor

RE: Decipher Java Language

6 Jul, 2009 - 02:32 AM
Post #4

New D.I.C Head
*

Joined: 24 Jan, 2009
Posts: 4


My Contributions
QUOTE(NickDMax @ 3 Jul, 2009 - 08:22 AM) *

Basically to implement a JVM in javascript?

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 smile.gif
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
User is offlineProfile CardPM
+Quote Post

mostyfriedman

RE: Decipher Java Language

6 Jul, 2009 - 02:40 AM
Post #5

Striving Student
Group Icon

Joined: 24 Oct, 2008
Posts: 3,144



Thanked: 355 times
Dream Kudos: 600
Expert In: Learning

My Contributions
there are some books on the JVM and stuff like that..you can check those out
User is offlineProfile CardPM
+Quote Post

Gasper

RE: Decipher Java Language

6 Jul, 2009 - 11:06 AM
Post #6

D.I.C Head
**

Joined: 29 May, 2009
Posts: 60



Thanked: 11 times
My Contributions
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
User is offlineProfile CardPM
+Quote Post

pbl

RE: Decipher Java Language

6 Jul, 2009 - 05:01 PM
Post #7

Java Lover
Group Icon

Joined: 6 Mar, 2008
Posts: 9,533



Thanked: 1124 times
Dream Kudos: 450
My Contributions
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
User is offlineProfile CardPM
+Quote Post

najolesor

RE: Decipher Java Language

7 Jul, 2009 - 09:34 PM
Post #8

New D.I.C Head
*

Joined: 24 Jan, 2009
Posts: 4


My Contributions
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


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


is there an app for translating .class to JS??

User is offlineProfile CardPM
+Quote Post

ayman_mastermind

RE: Decipher Java Language

7 Jul, 2009 - 10:56 PM
Post #9

human.setType("geek");
Group Icon

Joined: 12 Dec, 2008
Posts: 1,807



Thanked: 92 times
Dream Kudos: 525
My Contributions
I think that the Google Web Toolkit does some nice job in this case, check out this article:

http://www.artima.com/lejava/articles/java...javascript.html

Good luck smile.gif
User is offlineProfile CardPM
+Quote Post

syfran

RE: Decipher Java Language

12 Jul, 2009 - 04:30 AM
Post #10

Sole Survivor of Code Withdrawal
Group Icon

Joined: 12 Jul, 2009
Posts: 1,103



Thanked: 77 times
Dream Kudos: 225
My Contributions
Um... Anyone consider he might mean code instead of script? Go from a .class to java code
Makes a lot more sense to me.

If that is the case, look into a java decompiler. There are a bunch out there and they work fairly well.
User is offlineProfile CardPM
+Quote Post

pbl

RE: Decipher Java Language

17 Jul, 2009 - 08:47 PM
Post #11

Java Lover
Group Icon

Joined: 6 Mar, 2008
Posts: 9,533



Thanked: 1124 times
Dream Kudos: 450
My Contributions
QUOTE(ayman_mastermind @ 7 Jul, 2009 - 10:56 PM) *

I think that the Google Web Toolkit does some nice job in this case, check out this article:

http://www.artima.com/lejava/articles/java...javascript.html

Good luck smile.gif

AymanMastermind living wikipedia biggrin.gif
User is offlineProfile CardPM
+Quote Post

cfoley

RE: Decipher Java Language

18 Jul, 2009 - 05:48 PM
Post #12

D.I.C Addict
Group Icon

Joined: 11 Dec, 2007
Posts: 645



Thanked: 60 times
Dream Kudos: 25
My Contributions
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.
User is offlineProfile CardPM
+Quote Post

pbl

RE: Decipher Java Language

18 Jul, 2009 - 09:20 PM
Post #13

Java Lover
Group Icon

Joined: 6 Mar, 2008
Posts: 9,533



Thanked: 1124 times
Dream Kudos: 450
My Contributions
QUOTE(cfoley @ 18 Jul, 2009 - 05:48 PM) *

However, if you want to do something more productive you could do the dishes or mow the lawn.

lol biggrin.gif
P.S.
I'll remove the advanced tag from this topic
User is offlineProfile CardPM
+Quote Post

malerv

RE: Decipher Java Language

18 Jul, 2009 - 09:41 PM
Post #14

D.I.C Head
**

Joined: 1 Jul, 2009
Posts: 85



Thanked: 7 times
My Contributions
For the record (since no-one seem to care about) I don't find this meaningless nor useless nor less at all.

User is offlineProfile CardPM
+Quote Post

cfoley

RE: Decipher Java Language

19 Jul, 2009 - 05:15 AM
Post #15

D.I.C Addict
Group Icon

Joined: 11 Dec, 2007
Posts: 645



Thanked: 60 times
Dream Kudos: 25
My Contributions
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.
User is offlineProfile CardPM
+Quote Post

malerv

RE: Decipher Java Language

19 Jul, 2009 - 05:34 AM
Post #16

D.I.C Head
**

Joined: 1 Jul, 2009
Posts: 85



Thanked: 7 times
My Contributions
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 ...
User is offlineProfile CardPM
+Quote Post

cfoley

RE: Decipher Java Language

19 Jul, 2009 - 07:10 AM
Post #17

D.I.C Addict
Group Icon

Joined: 11 Dec, 2007
Posts: 645



Thanked: 60 times
Dream Kudos: 25
My Contributions
So why not just go from Java source code to JavaScript?

For me, JavaScript is about interacting with the DOM, and to write meaningful Java code for that, you'd have to mock the entire DOM. Yuck!
User is offlineProfile CardPM
+Quote Post

malerv

RE: Decipher Java Language

19 Jul, 2009 - 07:57 AM
Post #18

D.I.C Head
**

Joined: 1 Jul, 2009
Posts: 85



Thanked: 7 times
My Contributions
Yes
I said I found the topic interesting, but I am not sure about the viability of the project.
And I'll certainly not begin this kind of project.

User is offlineProfile CardPM
+Quote Post

cfoley

RE: Decipher Java Language

19 Jul, 2009 - 09:56 AM
Post #19

D.I.C Addict
Group Icon

Joined: 11 Dec, 2007
Posts: 645



Thanked: 60 times
Dream Kudos: 25
My Contributions
I must have misread you. I thought you said it wasn't useless at all. My bad.

Oh, that comes across way bitchier than I intended it. I agree it would be interesting but very hard to do right.
User is offlineProfile CardPM
+Quote Post

malerv

RE: Decipher Java Language

19 Jul, 2009 - 10:50 AM
Post #20

D.I.C Head
**

Joined: 1 Jul, 2009
Posts: 85



Thanked: 7 times
My Contributions
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 smile.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 07:13PM

Live Java Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month