Javascript versus Java3D?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • MStepansky

    #1

    Javascript versus Java3D?

    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



  • Michael Winter

    #2
    Re: Javascript versus Java3D?

    On 19 Oct 2004 06:13:01 GMT, MStepansky <mstepansky@aol .com> wrote:
    [color=blue]
    > Whats the difference between Javascript and Java3D?[/color]

    Assuming you're referring to the Java 3D API, a very big one.

    [snip]
    [color=blue]
    > Then I should learn Javascript BEFORE Java3D, right? no?[/color]

    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]
    [color=blue]
    > Whats the difference between Visual Basic and Visual Java++?[/color]

    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.

    Comment

    • Mark Preston

      #3
      Re: Javascript versus Java3D?

      MStepansky wrote:
      [color=blue]
      > Whats the difference between Javascript and Java3D?
      >[/color]
      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.
      [color=blue]
      > Worse, whats the difference between Java and Javascript?
      >[/color]
      Chalk --> Cheese. They are totally different languages.
      [color=blue]
      > 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?)
      >[/color]
      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.

      Comment

      • George Hester

        #4
        Re: Javascript versus Java3D?

        "Mark Preston" <usenet@nosourc e.co.uk> wrote in message news:cl33fk$b7$ 1$8300dec7@news .demon.co.uk...[color=blue]
        > MStepansky wrote:
        > [color=green]
        > > Whats the difference between Javascript and Java3D?[/color][/color]

        <snip>
        [color=blue]
        >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.[/color]

        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
        _______________ _______________ ____

        Comment

        • George Hester

          #5
          Re: Javascript versus Java3D?

          "MStepansky " <mstepansky@aol .com> wrote in message news:2004101902 1301.08579.0000 2236@mb-m12.aol.com...[color=blue]
          > Whats the difference between Javascript and Java3D?[/color]
          <snip>
          [color=blue]
          > Mike
          >
          >
          >[/color]

          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
          _______________ _______________ ____

          Comment

          • Grant Wagner

            #6
            Re: Javascript versus Java3D?

            George Hester wrote:
            [color=blue]
            > "MStepansky " <mstepansky@aol .com> wrote in message news:2004101902 1301.08579.0000 2236@mb-m12.aol.com...[color=green]
            > > Whats the difference between Javascript and Java3D?[/color]
            > <snip>
            >[color=green]
            > > Mike[/color]
            >
            > That reminds me. JavaScript is an interpreted language. Java (inclds Java 3D API) is a compiled language.[/color]

            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.
            [color=blue]
            > What does that mean? Well strong data types in a compiled language not in an interpreted.[/color]

            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.
            [color=blue]
            > 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 .[/color]

            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 />
            [color=blue]
            > 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.[/color]

            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.
            [color=blue]
            > 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)[/color]

            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 <gwagner@agrico reunited.com>
            comp.lang.javas cript FAQ - http://jibbering.com/faq

            Comment

            • Jim Ley

              #7
              Re: Javascript versus Java3D?

              On Wed, 20 Oct 2004 16:42:25 GMT, Grant Wagner
              <gwagner@agrico reunited.com> wrote:
              [color=blue]
              >While it is probably true that JavaScript is mostly interpreted, these are not features
              > of the language, but of the implementation of the language.[/color]

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

              for how JScript works

              Jim.

              Comment

              • Grant Wagner

                #8
                Re: Javascript versus Java3D?

                Jim Ley wrote:
                [color=blue]
                > On Wed, 20 Oct 2004 16:42:25 GMT, Grant Wagner
                > <gwagner@agrico reunited.com> wrote:
                >[color=green]
                > >While it is probably true that JavaScript is mostly interpreted, these are not features
                > > of the language, but of the implementation of the language.[/color]
                >
                > See Eric Lipperts comments on
                > http://blogs.msdn.com/ptorr/archive/.../14/56184.aspx
                >
                > for how JScript works
                >
                > Jim.[/color]

                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 "interprete d" 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 <gwagner@agrico reunited.com>
                comp.lang.javas cript FAQ - http://jibbering.com/faq

                Comment

                • Lasse Reichstein Nielsen

                  #9
                  Re: Javascript versus Java3D?

                  Grant Wagner <gwagner@agrico reunited.com> writes:
                  [color=blue]
                  > While it is probably true that JavaScript is mostly interpreted,
                  > these are not features of the language, but of the implementation of
                  > the language.[/color]

                  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.
                  [color=blue]
                  > JavaScript may be JIT (Just-in-time)-compiled before execution or it
                  > may be interpreted.[/color]

                  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.
                  [color=blue]
                  > Java is compiled into bytecode, which can then be JIT-compiled,
                  > interpreted or compiled to native code.[/color]

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

                  [color=blue][color=green]
                  >> What does that mean? Well strong data types in a compiled language
                  >> not in an interpreted.[/color]
                  >
                  > Since Java bytecode can be interpreted at runtime (and was in early
                  > Virtual Machines), this is simply not correct.[/color]

                  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 - lrn@hotpop.com
                  DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
                  'Faith without judgement merely degrades the spirit divine.'

                  Comment

                  • George Hester

                    #10
                    Re: Javascript versus Java3D?

                    "Grant Wagner" <gwagner@agrico reunited.com> wrote in message news:41769629.A 514E8FA@agricor eunited.com...
                    [color=blue]
                    > Since JavaScript and Java are unrelated except for four letters which happen to match, this makes JavaScript and the
                    > Java3D API unrelated.
                    >
                    > --
                    > Grant Wagner <gwagner@agrico reunited.com>
                    > comp.lang.javas cript FAQ - http://jibbering.com/faq
                    > [/color]

                    Excellent. Thanks Grant.
                    --
                    George Hester
                    _______________ _______________ ____

                    Comment

                    Working...