-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday 04 March 2004 12:11 pm, John Lamb wrote:
Steven T. Hatton wrote:
But is that innate to the language and the differences between byte compiling and assembling, or is it simply that C++ has libraries, and compiler features which support this kind of thing? Again, I have to refer to Java3D. I'm not sure how the javax.vectormath package would stand up, but it would be a likely place to look for optimized math algorithms.
Not innate. A CPU that was designed specifically to run java bytecode would probably run java at about the same speed as anything else compiled. I believe such a CPU has been suggested but not built.
The best optimized math algorithms are probably still written in FORTRAN, though that's a very specific problem and these libraries are very carefully crafted.
I'll give a simple example of why I don't accept that argument. A few years back I wrote some code to produce 3 random floats. I thought I had written to code correctly, it kept coming back with the same value for all three. Well, as it turns out, random isn't really random. It's a seeded algorithm designed to simulate floats. It generates subsequent values based on the system clock. The code was executing so fast it all happened in the same clock cycle. The CPU runs faster than the system clock, as you probably knew. As a related example, there are Java encryption implementations which directly access libraries written in C. Once the code's in memory, it doesn't matter how it got there, interpreted, bytecompiled, assembled, or entered with thumb switched counters. The instruction pointer increments from one instruction to the next, and loads instruction into the instruction register(s), prefetching, piplining, and all considered. As an example, Mathematica is an interpreted language with very limited capability to "compile". Compiling basically means bytecompiling, as I understand it. (It's just hyper-Lisp). Some calculations are extremely fast.
-- JDL
STH -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQFASCJFwX61+IL0QsMRAkRnAKCPqUnYH7RAv7ZfrSeJKiMbk9asmwCgv/Qe 4VMcSIcNsyAaQwDnpU1jofI= =pbaC -----END PGP SIGNATURE-----