Dlaczego java używa big endiana?

0

Witam, mam krótkie pytanie, na które nie potrafiłem znaleźć odpowiedzi:
Dlaczego java zapisuje liczby w big endianie? Przecież większość procesorów pracuje w little endian. Przy wykonywaniu obliczeń, maszyna wirtualna javy musi wpierw liczby zmienić w little endiana, wykonać obliczenia, a potem z powrotem zmienić w big endian, co jest chyba mało wydajne przy wielu operacjach, więc, jaki jest powód, dla którego w javie, jest używany big endian?

1

Big endian jest używany w protokołach internetowych.
http://en.wikipedia.org/wiki/Endianness#Endianness_in_networking

Inna sprawa to to czy w czasie tworzenia Javy rzeczywiście większość procesorów była little-endian. A zwłaszcza procesory w set-top boxach, do których Java była pierwotnie przeznaczona.

The Java platform and language began as an internal project at Sun Microsystems in December 1990, providing an alternative to the C++/C programming languages. Engineer Patrick Naughton had become increasingly frustrated with the state of Sun's C++ and C application programming interfaces (APIs) and tools. While considering moving to NeXT, Naughton was offered a chance to work on new technology and thus the Stealth Project was started.

The Stealth Project was soon renamed to the Green Project with James Gosling and Mike Sheridan joining Naughton. Together with other engineers, they began work in a small office on Sand Hill Road in Menlo Park, California. They were attempting to develop a new technology for programming next generation smart appliances, which Sun expected to be a major new opportunity.[14]

The team originally considered using C++, but it was rejected for several reasons. Because they were developing an embedded system with limited resources, they decided that C++ needed too much memory and that its complexity led to developer errors. The language's lack of garbage collection meant that programmers had to manually manage system memory, a challenging and error-prone task. The team was also troubled by the language's lack of portable facilities for security, distributed programming, and threading. Finally, they wanted a platform that could be easily ported to all types of devices.

Bill Joy had envisioned a new language combining Mesa and C. In a paper called Further, he proposed to Sun that its engineers should produce an object-oriented environment based on C++. Initially, Gosling attempted to modify and extend C++ (that he referred to as "C++ ++ --") but soon abandoned that in favor of creating a new language, which he called Oak, after the tree that stood just outside his office.

By the summer of 1992, they were able to demonstrate portions of the new platform including the Green OS, the Oak language, the libraries, and the hardware. Their first attempt, demonstrated on September 3, 1992, focused on building a personal digital assistant (PDA) device named Star7[2] that had a graphical interface and a smart agent called "Duke" to assist the user. In November of that year, the Green Project was spun off to become firstperson, a wholly owned subsidiary of Sun Microsystems, and the team relocated to Palo Alto, California.[15] The firstperson team was interested in building highly interactive devices, and when Time Warner issued a request for proposal (RFP) for a set-top box, firstperson changed their target and responded with a proposal for a set-top box platform. However, the cable industry felt that their platform gave too much control to the user and firstperson lost their bid to SGI. An additional deal with The 3DO Company for a set-top box also failed to materialize. Unable to generate interest within the TV industry, the company was rolled back into Sun.

Jeszcze inna sprawa to czy te endianess rzeczywiście dużo znaczą na x86. Od procka 486 jest instrukcja BSWAP która służy właśnie do zamiany kolejności bajtów i robi to raczej szybko.

0

Z tego co pamiętam, to konwersja jednego na drugi jest ultra szybka.

1 użytkowników online, w tym zalogowanych: 0, gości: 1