1998Q1/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev] byte&#45;code anyone? -->
<!--X-From-R13: ptNnzv&#45;pt.UenlEntr.Sqzbagba.OP.QO (Quevf Uenl) -->
<!--X-Date: Sat, 21 Feb 1998 07:01:16 +0000 -->
<!--X-Message-Id: 9802210101.8usy@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] byte-code anyone?</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="msg00547.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00549.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00643.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00540.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00548">Author</A>
&nbsp;|&nbsp;<A HREF="#00548">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00548">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>: <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, 20 Feb 98 18:01:28 MST</LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
[Jon Leonard:]

:Maybe I should have said "test with tiny cases first".  Whenever I've
:spent a long time tracking down a bug, it turns out that there's a simpler
:test that would have shown me the bug if I'd been more careful.
:Consequently, I test for correctness early and often.

Fully agreed here. I did in fact run some simple byte-code functions late
that weekend, but haven't done much since then. Most of my work gets done
on weekends. My main problems so far have been issues involving the
integration of the byte-code stuff with the rest of the system. Right
now the compiled byte-code gets saved in the DB, and loaded when the
function is referenced, but somewhere just after that, the byte-code
pointer seems to get NULL-ed. I'll get there eventually!

:That is the other option, controlling all the possible bytecode sources.
:Since my design calls for (eventually) passing code between servers that
:don't trust each other, I can't do that.

Ah yes, that'll do it. The same with Java, of course.

:It's a matter of taste, efficiency, and paranoia.
:
:I'm a little suprised that the default case slows it down a lot.  Maybe
:the C compiler doesn't know to just translate it as an index into a
:256-element jump table (I assume you switch() on a byte), and fill in
:all the unspecified ones with the default.

Well, I'm currently doing this with a non-C compiler of my own, so I'm
fully to blame for any inefficiencies. Currently, the compiler will omit
testing for range if the index type is an enumeration and all of the
enumeration values are explicitly mentioned in the case statement. The
choice between an index-case and a binary-search-case is based on the
density of the values. But you are right, I could likely note that the
index type is 1-byte, and just make a large enough table. I've also
thought about making the opcodes all be multiples of 2, so that the
case code doesn't have to do the shift to access the offsets (which
would also require hacking the compiler). The C version of my system
will be updated when the byte-code is done - I struggled with the choice
of which version to work in for this, and decided I prefer my own
language, and want to keep that version up-to-date anyway.

:File that under "Jon's advice to himself", then.  This stuff is taking
:me quite a while.  Maybe the fact that I keep working on other things
:is at fault.

Nod. I have even weaker excuses, actually :-(

--
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="msg00547.html">Re: [MUD-Dev] Unique items (was: Graphic MUDS/Ultima Online)</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00549.html">Re: [MUD-Dev] Clients</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00643.html">Re: [MUD-Dev]  Position sorting</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00540.html">Re: [MUD-Dev]	Back on the list</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00548"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00548"><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] 3D engines for MUDs (was: The MLI Project)</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<LI><strong><A NAME="00796" HREF="msg00796.html">Re: [MUD-Dev] 3D engines for MUDs (was: The MLI Project)</A></strong>, 
Michael Hohensee <a href="mailto:michael#mainstream,net">michael#mainstream,net</a>, Fri 20 Mar 1998, 21:15 GMT
</LI>
<LI><strong><A NAME="00798" HREF="msg00798.html">Re: [MUD-Dev] 3D engines for MUDs (was: The MLI Project)</A></strong>, 
Michael Hohensee <a href="mailto:michael#sparta,mainstream.net">michael#sparta,mainstream.net</a>, Fri 20 Mar 1998, 21:47 GMT
</LI>
</ul>
</ul>
</ul>
</ul>
</ul>
</ul>
</LI>
<LI><strong><A NAME="00553" HREF="msg00553.html">Position sorting</A></strong>, 
Adam Wiggins <a href="mailto:nightfall#user1,inficad.com">nightfall#user1,inficad.com</a>, Sun 22 Feb 1998, 13:17 GMT
<UL>
<LI><strong><A NAME="00643" HREF="msg00643.html">Re: [MUD-Dev]  Position sorting</A></strong>, 
coder <a href="mailto:coder#ibm,net">coder#ibm,net</a>, Sat 28 Feb 1998, 05:04 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00548" HREF="msg00548.html">Re: [MUD-Dev] 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>, Sat 21 Feb 1998, 07:01 GMT
<LI><strong><A NAME="00540" HREF="msg00540.html">Re: [MUD-Dev]	Back on the list</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Fri 20 Feb 1998, 16:16 GMT
<LI><strong><A NAME="00533" HREF="msg00533.html">Back on the list</A></strong>, 
Niklas Elmqvist <a href="mailto:d97elm#dtek,chalmers.se">d97elm#dtek,chalmers.se</a>, Fri 20 Feb 1998, 08:38 GMT
<UL>
<LI><strong><A NAME="00564" HREF="msg00564.html">Re: [MUD-Dev]  Back on the list</A></strong>, 
coder <a href="mailto:coder#ibm,net">coder#ibm,net</a>, Mon 23 Feb 1998, 19:13 GMT
<UL>
<LI><strong><A NAME="00574" HREF="msg00574.html">Dynamic Loading of Modules (was: Back on the list)</A></strong>, 
Niklas Elmqvist <a href="mailto:d97elm#dtek,chalmers.se">d97elm#dtek,chalmers.se</a>, Tue 24 Feb 1998, 08:19 GMT
</LI>
</UL>
</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>