forked from berkus/Juice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
intro.htm
189 lines (188 loc) · 10.3 KB
/
intro.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<!-- THIS PAGE WAS CREATED WITH WORLD WIDE WEB WEAVER 2.0
IN ORDER TO SEPARATE THIS PAGE INTO MULTIPLE SECTIONS COMMENT TAGS HAVE BEEN PLACED AT SPECIFIC LOCATIONS. REMOVING OR EDITING THESE COMMENTS WILL CAUSE WEB WEAVER TO NOT RECOGNIZE SECTIONS --><HTML>
<HEAD><TITLE>Introducing Juice</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000"><!-- BEGIN BODY HEADER SECTION --><!-- BEGIN MAIN BODY SECTION -->
<H1><CENTER><IMG SRC="IntroBan.gif" ALIGN="BOTTOM" WIDTH="468" HEIGHT="48"
NATURALSIZEFLAG="3"><BR>
<BR>
Introducing Juice</CENTER>
</H1>
<BR>
<B>Juice</B> is a new technology for distributing executable content across
the World Wide Web. In this respect, it is similar to <B><A HREF="http://java.sun.com/">Java</A></B>
from Sun Microsystems. However, as we will try to explain in the following,
Juice differs from Java in several important aspects that allows it to outperform
Java in many "downloadable Applets" applications. The advantages
of Juice become even more pronounced when the "Applets" are large.
Java, on the other hand, has an advantage in the area for which it was originally
invented: embedded applications in consumer electronics and household appliances.
Juice is intended to be a complement to Java, giving users a choice: <B>Java
or Juice</B>. <BR>
<BR>
<FONT SIZE=-1>"Java" is a trademark owned by Sun Microsystems,
Inc.<BR>
"Juice" is a trademark owned by the Regents of the University
of California </FONT>
<BR>
<P><CENTER><A HREF="index.html">Home</A> | Introduction
| <A HREF="download.html">Get Juice</A> | <A HREF="demo.html">Demo</A> |
<A HREF="authoring.html">Authoring</A></CENTER>
<P><HR SIZE="3">
<H2><CENTER>A Little History To Start With</CENTER>
</H2>
Juice isn't simply a "Java-lookalike" that we have created in
quick reaction to Sun Microsystems' Java announcement. Quite to the contrary,
work on Juice has preceded Java by several years, but it all happened in
an academic environment with more limited resources than available at Sun.
The only part of Juice that has been influenced by Java is the food-related
name.<BR>
<BR>
Juice grew out of a research project headed by Niklaus Wirth, the inventor
of the Pascal and Modula programming languages. His aim was to invent a
language that was at once simple and safe to use. The new language should
also support the object-oriented programming paradigm, be efficiently compilable,
and applicable to a wide range of programming tasks from systems programming
to teaching. A language with these properties was defined by Wirth in 1988
and given the name <B><A HREF="http://www.ics.uci.edu/~oberon/intro.html">Oberon</A></B>.
<BR>
<BR>
At first sight, Oberon and Java seem to be as different as two languages
can possibly be. Oberon looks a lot like Pascal (not very surprising, since
they were both invented by the same person), and Java looks a lot like C
(thereby appearing "familiar" to many programmers). A closer comparison
of Oberon and Java, however, yields surprisingly many similarities: both
languages
<UL>
<LI>are strongly typed while permitting the definition of "extended"
types that are backward-compatible with their ancestors,<BR>
<BR>
<LI>prohibit pointer arithmetic and mandate the presence of a garbage
collector in their run-time environment, and<BR>
<BR>
<LI>provide the notion of modular "packages" that are compiled
separately and dynamically linked at run-time
</UL>
Juice is to the Oberon language what the <B><A HREF="http://java.sun.com/java.sun.com/whitePaper.Platform/JavaPlatform.doc2.html#6978">Java
Virtual Machine</A></B> is to the Java language: the means of distributing
portable software. Work on what has now become Juice started in 1989 and
contributed to <A HREF="http://www.ics.uci.edu/~franz">Michael Franz</A>'s
Ph.D. degree in 1994. The title of his 1994 dissertation, almost a year
and a half before the announcement of Java, was "Code-Generation On-The-Fly:
A Key to Portable Software".<BR>
<BR>
<HR SIZE="3">
<H2><CENTER>What Is Juice and How Does It Differ From Java</CENTER>
</H2>
Juice encompasses three key components
<UL>
<LI>an architecture-neutral software distribution format,<BR>
<BR>
<LI>a compiler that translates from Oberon into the Juice portable format,
and<BR>
<BR>
<LI>a <B><A HREF="http://home.netscape.com/comprod/products/navigator/version_2.0/plugins/index.html">plug-in</A></B>
that enables the <B><A HREF="http://home.netscape.com/">Netscape</A></B>
and <A HREF="www.microsoft.com"><B>Microsoft Internet Explorer</B></A> browser to run Juice applets
</UL>
To the technical layman, the most notable difference between comparable
Juice and Java applets is probably that the Juice version of any applet
is likely to run a lot faster than its Java counterpart. Rather than being
interpreted, as Java applets normally are, Juice always compiles each applet
into the native code of the target machine before it begins execution. Once
that an applet begins executing, it runs at the full speed of compiled code.
Juice's on-the-fly compilation process is not only exceptionally fast, but
it also generates object code that is comparable in quality to commercial
C compilers. In contrast, even the latest just-in-time compilers for Java
that have been announced by major vendors are not yet trying to compete
with regular compilers.<BR>
<BR>
Further, the portable Juice representation is denser than Java byte-codes.
Users with slow connections to the Internet save time by downloading Juice
applets rather than Java applets of the same functionality. In fact, the
time saved by the faster downloading normally more than compensates for
the on-the-fly compilation phase.<BR>
<BR>
How then, do a few academic researchers manage to come up with a better
on-the-fly compiler than a whole industry of software companies? Well, the
key to Juice's effectiveness isn't really found in the compiler technology
embedded within the Netscape plug-in, but in the Juice software distribution
format itself: Behind the scenes, Juice and Java differ by far more than
one might expect.<BR>
<BR>
Java's distribution format is a sequence of so-called byte-codes: the inventors
of Java thought up an "ideal" processor designed specifically
for running Java programs and use the instruction set of this ideal processor
as the "intermediate language" in which Java programs are shipped.
Hence, on the programmer's side, a Java compiler translates the source into
a byte-code sequence, and on the side of the eventual consumer, a byte-code
interpreter simulates the ideal Java processor. It is entirely conceivable
that the ideal Java processor can actually be implemented in hardware, and
Sun has actually already announced such processors.<BR>
<BR>
Juice's distribution format, on the other hand, is far more complex. It
is based on a tree-shaped program representation as is typically used transiently
within optimizing compilers. Rather than containing a linear code-sequence
that can be interpreted byte-by-byte, a Juice-encoded applet contains a
compressed tree that describes the actions of the original program. The
tree preserves the control-flow structure of the original program, which
makes it much easier to perform code optimization while the tree is translated
into the native instruction set of the target machine.<BR>
<BR>
As an example of what kinds of optimizations may be beneficial, consider
a modern processor that has several functional units. These require a certain
instruction-mix in order to operate at top speed. By re-ordering certain
mutually independent instructions, a better instruction-mix may be achieved.
A tree-based encoding maintains the notion of a basic block and makes it
relatively easy to decide if two instructions are mutually independent.
This is not so simple with a linear instruction stream, such as Java byte-codes,
in which any instruction can potentially be the target of a branch.<BR>
<BR>
Further, our tree-based encoding avoids many of the security issues that
are difficult to solve in Java, or in any virtual-machine representation
for that matter. By the very definition of our tree-encoding scheme, it
is impossible to encode a tree that violates scoping rules of our source
language. Such an "illegal" program cannot even be constructed
by hand. Java's byte-code instructions, on the other hand, are at a much
lower semantic level. Although it is possible to verify that a given byte-code
sequence doesn't perform any illegal action, this requires data-flow analysis
and a partial repetition of the compiler's integrity checks. The tree-based
Juice distribution format in effect makes this particular data-flow analysis
unnecessary. It also allows for highly efficient load-time integrity checking,
as every node in the encoded tree is fully typed.<BR>
<BR>
<HR SIZE="3">
<H2><CENTER>How to Obtain Juice</CENTER>
</H2>
The easiest way to learn more about Juice is by simply having a look at
it. In order to do this, you need to install the Netscape Juice plug-in.
This plug-in is available for the following platforms:
<UL>
<LI>Apple PowerPC Macintosh<BR>
<BR>
<LI>PC-compatible running Windows 95
</UL>
<A HREF="download.html">Download</A> the plug-in as required by your Netscape
installation, then go to our <A HREF="demo.html">Juice demo page</A>.<BR>
<P><CENTER><HR SIZE="3"></CENTER>
<H2><CENTER>Conclusion</CENTER>
</H2>
We believe that Juice is a better technology than Java for bringing executable
content to the World Wide Web. Juice allows substantial amounts of software
to be encoded space-efficiently, and to be compiled on-the-fly into high-quality
code. The Juice architecture-neutral distribution format has a variety of
properties that make it inherently better suited for applications that require
the speed of optimized object code.<BR>
<BR>
Java, on the other hand, is the better choice in the domain for which it
was originally created: embedded applications in consumer electronics and
household appliances. Aided by a hardware implementation of the Java virtual
machine, this creates a standard run-time architecture for embedded software
that requires a small memory footprint.<BR>
<HR>
<ADDRESS>University of California, Irvine<BR>
<A HREF="mailto:franz@uci.edu">Michael Franz</A> and <A HREF="mailto:kistler@ics.uci.edu">Thomas
Kistler</A><BR>
30th October 1996 </ADDRESS>
<!-- BEGIN BODY FOOTER SECTION --></BODY>
</HTML>