Search code examples
javajvmsmalltalkvm-implementation

What does it mean that Squeak runs "bit-identically" across platforms, in a way Java doesn't?


Alan Kay points out that "Unlike Java, [Squeak] runs bit-identical on every machine -- we invented this 20 years ago". The wikipedia page mentions this also:

Squeak is available for many platforms, and programs produced on one platform run bit-identical on all other platforms.

Since machines with different instruction sets obviously can't run bit-identical programs natively, what does it mean when one says that Squeak runs bit-identical programs on different machines, in a way that Java doesn't?

I'm under the impression that compiled Java classes runs identically on any machine on any JVM, is that not so?


Solution

  • The obvious interpretation is that executing the same image on different machines with the same inputs will result in the image evolving through the same bit patterns. This post about Squeak's floating point math implies that the floating point has identical representation on different platforms. Java requires that semantics are the same between platforms, but permits denormalised representations. The library Squeak uses to ensure bit-identical floating point across platform is Sun's one, which the Sun JVM also uses, though they mention further restricting it with compiler settings.