1998Q1/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev]  byte&#45;code anyone? -->
<!--X-From-R13: Xba Zrbaneq <wyrbaneqNqvipbz.hzbc&#45;nc.pbz> -->
<!--X-Date: Mon, 16 Feb 1998 04:14:13 +0000 -->
<!--X-Message-Id: 19980213170214.44586#divcom,umop&#45;ap.com -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 9802120611.8tfe@ami&#45;cg.GraySage.Edmonton.AB.CA -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev]  byte-code anyone?</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:jleonard#divcom,umop-ap.com">
</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="msg00472.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00474.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00429.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00408.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00473">Author</A>
&nbsp;|&nbsp;<A HREF="#00473">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00473">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev]  byte-code anyone?</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]  byte-code anyone?</LI>
<LI><em>From</em>: Jon Leonard &lt;<A HREF="mailto:jleonard#divcom,umop-ap.com">jleonard#divcom,umop-ap.com</A>&gt;</LI>
<LI><em>Date</em>: Fri, 13 Feb 1998 17:02:14 -0800</LI>
<LI><em>Cc</em>: Jon Leonard &lt;<A HREF="mailto:jleonard#divcom,umop-ap.com">jleonard#divcom,umop-ap.com</A>&gt;</LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
On Wed, Feb 11, 1998 at 11:15:06PM +0000, Chris Gray wrote:

[problem involving lots of computation in a MUD (world generation)]

&gt; to be done on it, however (it's pretty cantakerous about settings). I've
&gt; been doing it within my MUD server, mostly because that's convenient - if
&gt; I mess up, nothing crashes, and the access to graphics is trivial (I need
&gt; Java, I know!).

&gt; My problem with the way I do it is that it is waaaay too slow. So, having
&gt; just finished reading the Java Virtual Machine book, I decided it would
&gt; be fun to add a byte-code system to my server. So, I've started out on
&gt; that. I've done sort-of similar things before, but never one quite like
&gt; this one (designed to do certain things as fast as possible).
&gt;
&gt; Any general comments or discussions out there on this sort of thing? Have
&gt; any of you done true byte-code systems before? How did they work out?
&gt; I'm not looking for source code or anything like that - that would take
&gt; the fun out of it! That may sound a bit wierd, but keep in mind that I'm
&gt; in the MUD area simply because its can be a fun area to program in.

I've been implementing something similar in the MUD I'm writing, but I
realized fairly early on that I could get even better speedups by compiling
all the way to machine code instead of just to bytecode.  (What JIT runtimes
do for Java)

This sort of thing is well covered in compiler textbooks -- there's a
source language, possibly and intermediate code, and an output code.  The
twist that a bytecode adds is that the target machine is virtual, and
supposedly proof against crashing.  My favorite compiler book is
_Compilers, Principles, Techniques, and Tools_ by Aho, Sethi and Ullman.

My recommendations would be more complete if I were done, but here's the
advice I'm giving myself:

1) Test the virtual machine carefully starting early on, so fewer bugs need
  to be laboriously traced by single-stepping an interpreter.

2) Design so that no matter how perverse the byte codes you get fed are,
  you don't crash or violate security assumptions.  Going from an interpreted
  language to byte codes or machine code makes demonstrating correctness
  much harder.
 
3) Pick carefully what the simple primitives are.  Missing a vital one
  can cost lots of performance, but too many bloats your
  interpreter/compiler/security model.

4) Don't expect to be done soon.  A compiler can be a lot of work.

If there's interest in my example code to generate C, compile it, and
dynamic link it in, I'll clean it up an stick it on my web page.  It
relies on the dlopen calls of modern UNIXs (tested on Linux), so it's
probably not of use to Chris.  (AmigaDos port coming after all my other
projects...)

Jon Leonard

</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00429" HREF="msg00429.html">byte-code anyone?</A></STRONG>
<UL><LI><EM>From:</EM> cg#ami-cg,GraySage.Edmonton.AB.CA (Chris Gray)</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00472.html">Re: [MUD-Dev] DBs and Events</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00474.html">Re: [MUD-Dev]  Clients</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00429.html">byte-code anyone?</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00408.html">[RESEARCH]MUD articles archive (fwd)</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00473"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00473"><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>Re: [MUD-Dev]  Clients</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<ul compact>
<LI><strong><A NAME="00513" HREF="msg00513.html">Re: [MUD-Dev]  Clients</A></strong>, 
Adam Wiggins <a href="mailto:nightfall#user2,inficad.com">nightfall#user2,inficad.com</a>, Tue 17 Feb 1998, 15:30 GMT
</LI>
<LI><strong><A NAME="00527" HREF="msg00527.html">Re: [MUD-Dev]  Clients</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Wed 18 Feb 1998, 18:51 GMT
</LI>
</ul>
</ul>
</ul>
</LI>
<LI><strong><A NAME="00430" HREF="msg00430.html">Re: [MUD-Dev] Source Code Release</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Thu 12 Feb 1998, 07:10 GMT
<LI><strong><A NAME="00429" HREF="msg00429.html">byte-code anyone?</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Thu 12 Feb 1998, 07:05 GMT
<UL>
<LI><strong><A NAME="00473" HREF="msg00473.html">Re: [MUD-Dev]  byte-code anyone?</A></strong>, 
Jon Leonard <a href="mailto:jleonard#divcom,umop-ap.com">jleonard#divcom,umop-ap.com</a>, Mon 16 Feb 1998, 04:14 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00408" HREF="msg00408.html">[RESEARCH]MUD articles archive (fwd)</A></strong>, 
Greg Munt <a href="mailto:greg#uni-corn,demon.co.uk">greg#uni-corn,demon.co.uk</a>, Wed 11 Feb 1998, 21:24 GMT
<LI><strong><A NAME="00406" HREF="msg00406.html">Re: [MUD-Dev] DBs and Events</A></strong>, 
Felix A. Croes <a href="mailto:felix#xs1,simplex.nl">felix#xs1,simplex.nl</a>, Wed 11 Feb 1998, 20:59 GMT
<LI><strong><A NAME="00401" HREF="msg00401.html">META: Unsubscribed users dur to bounces</A></strong>, 
coder <a href="mailto:coder#ibm,net">coder#ibm,net</a>, Wed 11 Feb 1998, 18:40 GMT
<UL>
<LI><strong><A NAME="00428" HREF="msg00428.html">Re: [MUD-Dev]  META: Unsubscribed users dur to bounces</A></strong>, 
Adam Wiggins <a href="mailto:nightfall#user2,inficad.com">nightfall#user2,inficad.com</a>, Thu 12 Feb 1998, 07:00 GMT
</LI>
</UL>
</LI>
</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>