[Home] [Groups] - Message: [Prev in Group] [Next in Group]
8548: [MUD-Dev] Re: PDMud thread summary
[Full Header] [Plain Text]
From: "Jon A. Lambert" <jlsysinc@ix.netcom.com>
Newsgroups: nu.kanga.list.mud-dev
Date: Fri, 23 Oct 1998 11:05:51 -0400
Organization: Kanga.Nu
> From: Jon A. Lambert <jlsysinc@ix.netcom.com>
>
Replying to my post. Sort of like talking to myself. ;)
>
> An example header entry protocol using name-mangling:
>
> #module@function!offset$arg1$arg1...$argn
>
> Where #module is the module or class name
> Where @function is the function name, method name, or dataname
> Where !offset is the relative offset to executable bytecode or symbol table
> Where $arg entry would be of the following format
>
Upon further review this is lame name mangling scheme..
Rather: #module@function$args makes more sense.
The first 3 parts can be used to match the function called
allowing polymorphism. !offset shouldn't be part of a scheme but
can be included in a module header in table format:
#mangled_name offset
I think Chris Gray mentioned fixing bytecode memory addresses
at startup, allowing direct jumps into functions. While a performance
boost, it makes dynamic registration and unregistration of modules
more complex.
Are function calls resolved at compile-time, registration, or run-time?
> $ style type
>
> Where style would be:
> a argument
> r return
Having the return value, buys nothing either, since the caller may not use
it and wouldn't be able to build a proper mangled name.
> int cast(int time, string spell) ----> #magic@cast!0x00000000$ri$ai$as
> char foo(char * bptr, bar i) ----> #magic@foo!0x1FBA2000$rc$apc$aebar
int cast(int time, string spell) ----> #magic@cast$ai$as
char foo(char * bptr, bar i) ----> #magic@foo$apc$aebar
For a standard call format, why not just have the caller push() it's address and then all the
arguments from left-to-right onto the stack then jump to the callee. The callee pops() them
out and loads local variables right-to-left. Return would pop() the return address off the
stack and push() the result and jump to the address just popped.
This is pretty simple. There maybe better ways of doing this. Message passing perhaps?
Thoughts?