By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,288 Members | 3,027 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,288 IT Pros & Developers. It's quick & easy.

Javascript versus Java3D?

P: n/a
Whats the difference between Javascript and Java3D?

I mean can Javascript do like Java3D can? Or is Java3D on top of Javascript
(the core, if thats what it is)? Then I should learn Javascript BEFORE Java3D,
right? no?

Worse, whats the difference between Java and Javascript?

Whats the difference between Visual Basic and Visual Java++? (I still thought
Visual Basic is like BASIC programming to allow you to write
windows/forms/dialog boxes, etc, right?)

Never mind JavaGenie, JavaBeans, etc. which is about to burst my brain out in
my ear channel (chinese doctor says "Mike, dont worry, thats not your brain -
thats your wax museum!")

Mike

Jul 23 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
On 19 Oct 2004 06:13:01 GMT, MStepansky <ms********@aol.com> wrote:
Whats the difference between Javascript and Java3D?
Assuming you're referring to the Java 3D API, a very big one.

[snip]
Then I should learn Javascript BEFORE Java3D, right? no?
No. Java and Javascript are related by name, and some common syntax, but
that's all. They are *not* the same language. They aren't even from the
same company, of developed with the same purpose in mind.

[snip]
Whats the difference between Visual Basic and Visual Java++?


What? You're asking for a comparison between two completely different
languages.

[snip]

If you want to learn about Java technologies, this is not the place to
ask; the comp.lang.java.* hierarchy is. I suggest you start with
comp.lang.java.help, or perhaps Sun's Java site
(<URL:http://java.sun.com/>).

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #2

P: n/a
MStepansky wrote:
Whats the difference between Javascript and Java3D?
One is a Java API (Java 3D) and one is nothing at all to do with Java
(obviously, JavaScript). They are in every way different and are
completely unrelated.
Worse, whats the difference between Java and Javascript?
Chalk --> Cheese. They are totally different languages.
Whats the difference between Visual Basic and Visual Java++? (I still thought
Visual Basic is like BASIC programming to allow you to write
windows/forms/dialog boxes, etc, right?)

Visual Basic is a form of Basic. As far as I know (and I could be wrong)
there is not and has never been any such thing as "Visual Java++". There
was once a thing called "Visual J++" but that was neither a version of
Basic nor a version of Java but something Microsoft made up by
(basically) swiping large lumps of Java and then changing it about a bit
so that it wasn't Java any more.
Jul 23 '05 #3

P: n/a
"Mark Preston" <us****@nosource.co.uk> wrote in message news:cl******************@news.demon.co.uk...
MStepansky wrote:
Whats the difference between Javascript and Java3D?

<snip>
There
was once a thing called "Visual J++" but that was neither a version of
Basic nor a version of Java but something Microsoft made up by
(basically) swiping large lumps of Java and then changing it about a bit
so that it wasn't Java any more.


Well only if you used the Windows Forms extensions. If you didn't it was
a passable java compiler. Java 1.1 I believe is where support ended with it.
I use it Java 1.4 and I have yet to get a .java I cannot compile with it.

George Hester
__________________________________
Jul 23 '05 #4

P: n/a
"MStepansky" <ms********@aol.com> wrote in message news:20***************************@mb-m12.aol.com...
Whats the difference between Javascript and Java3D? <snip>
Mike



That reminds me. JavaScript is an interpreted language. Java (inclds Java 3D API) is a compiled language.

What does that mean? Well strong data types in a compiled language not in an interpreted.

Functions can be created at any time. Not like Java where functions have to be declared first as well as their
data type.

Java uses a class main{} to begin the program JavaScript does not have that issue of where to start. It starts in
<script type="text/javascript">
// javascript code
</script>.
and the Browser sees it and passes the info on to the JavaScript interpreter in the Browser .

JavaScript embeds in software (like a browser). Other software provides the input and output facilities and the
substance that JavaScript scripts act on in the form of objects.

An interpreted language needs to reside in an application such as a browser. There is no such
thing as a standalone JavaScript Program. Cannot make an executable with JavaScript. You can with Java either
a exe in Windows or a jar in Linux and what not (Windows too if you don't let WinZip snag it)

--
George Hester
__________________________________
Jul 23 '05 #5

P: n/a
George Hester wrote:
"MStepansky" <ms********@aol.com> wrote in message news:20***************************@mb-m12.aol.com...
Whats the difference between Javascript and Java3D? <snip>
Mike


That reminds me. JavaScript is an interpreted language. Java (inclds Java 3D API) is a compiled language.


While it is probably true that JavaScript is mostly interpreted, these are not features of the language, but of the
implementation of the language.

JavaScript may be JIT (Just-in-time)-compiled before execution or it may be interpreted. If someone bothered, it could
even be compiled into a native binary executable. And in fact, JScript.NET is compiled into Microsoft's Intermediate
Language (MSIL) (like Java bytecode) which is then JIT-compiled and executed by the CLR (Common Language Runtime).

Java is compiled into bytecode, which can then be JIT-compiled, interpreted or compiled to native code.
What does that mean? Well strong data types in a compiled language not in an interpreted.
Since Java bytecode can be interpreted at runtime (and was in early Virtual Machines), this is simply not correct. An
interpreted language can be strongly typed. It just happens that JavaScript is a weakly typed interpreted (or more
likely, JIT-compiled) language.
Java uses a class main{} to begin the program JavaScript does not have that issue of where to start. It starts in
<script type="text/javascript">
// javascript code
</script>.
and the Browser sees it and passes the info on to the JavaScript interpreter in the Browser .
Java executables may or may not have a main() method. Java Applets don't have a main() method and are started by the
browser executing the methods required by all sub-classes of Applet: init(), start(), stop(), destroy() <url:
http://java.sun.com/j2se/1.4.2/docs/...et/Applet.html />
JavaScript embeds in software (like a browser). Other software provides the input and output facilities and the
substance that JavaScript scripts act on in the form of objects.
JavaScript is executed (either JIT-compiled or interpreted) by a host environment of some kind. Although I'd say that
for all applications "...Other software provides the input and output facilities...". Usually that software is the
underlying operating system. Java itself has no facilities for interacting directly with the user, although it does
have pre-defined classes (like System.in and System.out) that interact with the standard input and output mechanisms
provided by the operating system.
An interpreted language needs to reside in an application such as a browser. There is no such
thing as a standalone JavaScript Program. Cannot make an executable with JavaScript. You can with Java either
a exe in Windows or a jar in Linux and what not (Windows too if you don't let WinZip snag it)


An interpreted language needs to be interpreted by an interpreter. That interpreter can be inside a Web browser, or
something like wscript or cscript (which does let you run a "standalone" JavaScript program, if you accept that code
being interpreted or JIT-compiled by a VM is a "standalone" program). With Java, everything compiles to bytecode in
..class files, which, interestingly enough, are not "standalone" programs either (or are, depending how how you view
the Virtual Machine), they require the Java Virtual Machine to either JIT-compile or interpret them.

JAR files are simply a way of distributing multiple .class files (and other resources like images or sound files) in a
simple package. They contain .class files, which still require the JVM to be run.

You _can_ make "standalone" Windows executables from Java .class/.jar applications using a tool like Excelsior JET
<url: http://www.excelsior-usa.com/jet.html />, but doing this destroys the cross-platform nature of Java (Java allows
the same .class to run on multiple computers and operating systems with little or no modification).

And since there are development environments better suited to Windows, writing an application in a cross-platform tool
such as Java and then compiling it to a Windows binary executable seems a bit silly.

In the end, the explanation for the original question is simple:

- JavaScript is an implementation of ECMAScript
- The Java 3D API provides a set of object-oriented interfaces that support a simple, high-level programming model you
can use to build, render, and control the behavior of 3D objects and visual environments. With the Java 3D API, you
can incorporate high-quality, scalable, platform-independent 3D graphics into applications and applets based on Java
technology <url: http://java.sun.com/products/java-media/3D/ />

Since JavaScript and Java are unrelated except for four letters which happen to match, this makes JavaScript and the
Java3D API unrelated.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq

Jul 23 '05 #6

P: n/a
On Wed, 20 Oct 2004 16:42:25 GMT, Grant Wagner
<gw*****@agricoreunited.com> wrote:
While it is probably true that JavaScript is mostly interpreted, these are not features
of the language, but of the implementation of the language.


See Eric Lipperts comments on
http://blogs.msdn.com/ptorr/archive/.../14/56184.aspx

for how JScript works

Jim.
Jul 23 '05 #7

P: n/a
Jim Ley wrote:
On Wed, 20 Oct 2004 16:42:25 GMT, Grant Wagner
<gw*****@agricoreunited.com> wrote:
While it is probably true that JavaScript is mostly interpreted, these are not features
of the language, but of the implementation of the language.


See Eric Lipperts comments on
http://blogs.msdn.com/ptorr/archive/.../14/56184.aspx

for how JScript works

Jim.


Thanks for the link, I found this to be on-point and of particular interest (courtesy of
Eric Lippert):

....Every now and then, people talk about "compiled" versus "interpreted" languages, and how
they are different. This distinction is both arbitrary and vague, and indeed, JScript
Classic (as opposed to .NET - grant) blurs the line considerably. JScript Classic acts like
a compiled language in the sense that before any JScript Classic program runs, we fully
syntax check the code, generate a full parse tree, and generate a bytecode. We then run the
bytecode through a bytecode interpreter. In that sense, JScript is every bit as "compiled"
as Java. The difference is that JScript does not allow you to persist or examine our
proprietary bytecode. Also, the bytecode is much higher-level than the JVM bytecode -- the
JScript Classic bytecode language is little more than a linearization of the parse tree,
whereas the JVM bytecode is clearly intended to operate on a low-level stack machine...

Off-topic: More fascinating stuff at <url:
http://www.microsoft.com/downloads/d...ng=en#filelist
/>

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq

Jul 23 '05 #8

P: n/a
Grant Wagner <gw*****@agricoreunited.com> writes:
While it is probably true that JavaScript is mostly interpreted,
these are not features of the language, but of the implementation of
the language.
I would say that it is a feature of the language, given that the "eval"
function is part of the specification. Having "eval" means that you must
be able to execute source code at runtime without a separate compilation
step.
JavaScript may be JIT (Just-in-time)-compiled before execution or it
may be interpreted.
Any interpreted language can be JIT-compiled to another language.
What makes a compiled language compiled, and not interpreted, is the
ability to separate the compilation and the interpretation of the
compiled code, thereby allowing the same compiled code to be run more
than once.

A JIT-compiler will probably generate code that has hooks into the
current runtime environment, so the compiled code can't easily be
separated. Running the same program an hour later will then require a
second JIT-step.

Java is a compiled language. It guarantees that you can convert source
code to class files that can later be linked/loaded and run several
times.

Javascript is most often interpreted, but can be compiled if need be.
However the runtime environment needs to have the entire compiler
included as well.

Any language can be compiled, but some require the ability to compile
at run-time, making the compiler part of the language. Javascript is
one.

Any language can be interpreted, but some require the ability to
create object files that can be linked and run later. Java is one.
Java is compiled into bytecode, which can then be JIT-compiled,
interpreted or compiled to native code.


.... which is interpreted :)
All languages are eventually interpreted anyway, because machine code
is interpreted by the microcode :).

What does that mean? Well strong data types in a compiled language
not in an interpreted.


Since Java bytecode can be interpreted at runtime (and was in early
Virtual Machines), this is simply not correct.


Well, "strong" and "weak" typing means something else, so I guess the
distinction really is between static and dynamic typing of variables.

In a statically typed language, a variable's type is determined...,
well statically. It is defined by the program as it exists before it
is run (i.e., only by the source code).

In a dynamically typed language, a variable does not have a type,
but its values do. Their types are determined dynamically as the
program runs.

(IIRC, a weakly typed language would allow the same value to have more
than one type, whereas a strong type system means that a value has at
most on type. An example of a weak type system is the union
construction in C).

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #9

P: n/a
"Grant Wagner" <gw*****@agricoreunited.com> wrote in message news:41***************@agricoreunited.com...
Since JavaScript and Java are unrelated except for four letters which happen to match, this makes JavaScript and the
Java3D API unrelated.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq


Excellent. Thanks Grant.
--
George Hester
__________________________________
Jul 23 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.