Differences Between Phantom and Java
Phantom is similar in many respects to Java, a language Sun was developing
in secret at the time the Phantom project began (in October of 1994).
The basic goal of Java is similar to that of Phantom: provide a secure and portable language and runtime environment
for developing dynamically-extensible, interactive applications for the Internet. The basic approach is similar
as well: both Java and Phantom provide a safe language with a number of modern programming features, and support
a secure mechanism for sending code across sites.
However, there are a number of differences between Phantom and Java. Here is an unashamedly biased account of
some of the differences:
- As might be expected from a project with a three year head-start, the Java implementation is at a much more
advanced stage of development than the Phantom implementation. In particular, Java has a wealth of standard libraries,
working networking code, and a compelling application (HotJava).
- Java is based on a safe subset of C++ and Objective C; Phantom is based on a safe subset of Modula-3.
- The Java team don't believe in transparent distribution, so only provide low-level networking APIs. In contrast,
Phantom provides transparent, language-level distribution of both code and data using the distributed lexical scoping
semantics of Obliq.
- Java can clearly be used to write disconnected agents: small programs which are transmitted to a user's
site for local execution. However, Java doesn't support connected agents: programs which carry their network
connections with them as they travel across sites. Phantom supports both models of code distribution, as a result
of using Obliq's distributed semantics.
- Java's mobile code mechanism is based on a runtime which dynamically obtains the code for classes from across
the network as they are needed. Phantom provides a similar mechanism, but also gives the programmer flexible control
over the code transmission mechanism through the use of higher-order functions.
- The Java team are focusing their efforts on interactive applications for the Web; Phantom attempts to be more
widely applicable to other application domains (such as distributed conferencing).
And finally:
Sun have twenty-five people working on Java. Phantom
only has one. :-)
Antony Courtney, <antony@apocalypse.org>