1998Q1/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev]	Why not compile java into object code? -->
<!--X-From-R13: ptNnzv&#45;pt.UenlEntr.Sqzbagba.OP.QO (Quevf Uenl) -->
<!--X-Date: Sat, 28 Feb 1998 02:20:34 +0000 -->
<!--X-Message-Id: 9802280139.8vbq@ami&#45;cg.GraySage.Edmonton.AB.CA -->
<!--X-Content-Type: text/plain -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev]	Why not compile java into object code?</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00635.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00637.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00676.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00632.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00636">Author</A>
&nbsp;|&nbsp;<A HREF="#00636">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00636">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev]	Why not compile java into object code?</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#null,net">mud-dev#null,net</A></LI>
<LI><em>Subject</em>: Re: [MUD-Dev]	Why not compile java into object code?</LI>
<LI><em>From</em>: <A HREF="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</A> (Chris Gray)</LI>
<LI><em>Date</em>: Fri, 27 Feb 98 18:39:29 MST</LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
:What would it take to compile java down into object code (.o files)?
:It's not being done...but I wonder why?  I don't care if I have to compile
:for each platform...if I compile just for win95 80% of my users will enjoy
:a tremendous speedup....

There are likely some other replies to this in the queue, but I'll take
a shot at it.

One of the big difficulties is the dynamic nature of inheritance in Java.
If class A inherits from class B, then the set of class member variables
in class B is not known until the details of class A have also been
examined. Similar problems come up with member functions - if class B
has a member function 'F', then a call to 'F' in the context of A might
call it, or might not, depending on whether A also has an 'F'. C++ figures
all this out at compile time because each compilation includes all of
the header files for all of the classes in the hierarchy. Java doesn't
have header files, but would require parsing the source files to extract
the equivalent information. Thus, compiling the source for class A requires
also having had compiled class B, and everything else in the inheritance
chain. Also, such a system would have to have a way of noticing that
class B has changed, and thus the object file for class A is out of date.

All of this sort of checking and setup is normally done when classes are
loaded - see the detailed description of class loading in the language
specification. After a class is loaded, it is assumed to be fixed in stone
as of that point.

:On a similar level, is this what JIT compilers do?  If so, could not
:someone write a JIT that produces an ordinary exe?

I believe that JIT only produces machine code at run-time. A class or
function is compiled just before it is first used (hence the name Just
In Time). At that point, all the details of it are known, so compilation
is possible.

So, in theory Java could be compiled to stand-alone object files, but that
compilation requires compiling, and fixing in stone, pretty well everything
in the referenced parts of the entire class hierarchy.

--
Chris Gray   cg#ami-cg,GraySage.Edmonton.AB.CA

</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00635.html">Re: [MUD-Dev]  Tutorial: Let's build a Compiler! - Comments</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00637.html">Re: [MUD-Dev] Clients</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00676.html">Re: [MUD-Dev] Clients</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00632.html">Tutorial: Let's build a Compiler! - Part VI: Boolean Expressions</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00636"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00636"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><strong><A NAME="00646" HREF="msg00646.html">Tutorial: Let's build a Compiler! - Part VIII: A Little Philosophy</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Sat 28 Feb 1998, 21:42 GMT
<LI><strong><A NAME="00637" HREF="msg00637.html">Re: [MUD-Dev] Clients</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sat 28 Feb 1998, 02:20 GMT
<UL>
<LI><strong><A NAME="00638" HREF="msg00638.html">Re: [MUD-Dev] Clients</A></strong>, 
Vadim Tkachenko <a href="mailto:vadimt#4cs,com">vadimt#4cs,com</a>, Sat 28 Feb 1998, 02:54 GMT
</LI>
</UL>
<UL>
<li>&lt;Possible follow-up(s)&gt;<br>
<LI><strong><A NAME="00676" HREF="msg00676.html">Re: [MUD-Dev] Clients</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Tue 03 Mar 1998, 20:25 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00636" HREF="msg00636.html">Re: [MUD-Dev]	Why not compile java into object code?</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sat 28 Feb 1998, 02:20 GMT
<LI><strong><A NAME="00632" HREF="msg00632.html">Tutorial: Let's build a Compiler! - Part VI: Boolean Expressions</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Fri 27 Feb 1998, 23:58 GMT
<LI><strong><A NAME="00631" HREF="msg00631.html">Tutorial: Let's build a Compiler! - Part V: Control Constructs</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Fri 27 Feb 1998, 23:55 GMT
<LI><strong><A NAME="00629" HREF="msg00629.html">Tutorial: Let's build a Compiler! - Part III: More Expressions</A></strong>, 
Jon A. Lambert <a href="mailto:Jon.A.Lambert#ix,netcom.com">Jon.A.Lambert#ix,netcom.com</a>, Fri 27 Feb 1998, 23:25 GMT
<LI><strong><A NAME="00628" HREF="msg00628.html">Tutorial: Let's build a Compiler! - Part IV: Interpreters</A></strong>, 
Jon A. Lambert <a href="mailto:Jon.A.Lambert#ix,netcom.com">Jon.A.Lambert#ix,netcom.com</a>, Fri 27 Feb 1998, 23:25 GMT
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>