develooper Front page | perl.perl6.internals | Postings from January 2002

Some random design notes

Thread Next
From:
Dan Sugalski
Date:
January 8, 2002 13:14
Subject:
Some random design notes
Message ID:
5.1.0.14.2.20020108161409.01feeb18@pop.sidhe.org
This is just a collection of random notes I put together while serving
jury duty. There's not much coherence here, but better to get it down
than not.

-----------
Global namespaces need to be multilevel the way lexical spaces
are.  Ruby and Python both require this. (Well, it's not required but
it makes things easier)

Objects need to have a private method cache, as we may need per-object
methods.

We need per-PMC attributes.

Each object might have its own private variables. We'll know at
compile-time, though.

-----------

Attributes are done as a hash of hashes. Each interpreter has a
pointer to an attribute hash, whose keys are the attribute names. The
values will be hash pointers. Those hashes will each have a key which
is a PMC pointer (hashed up somehow) and the value is the attribute
value.

-----------

We need private methods for objects.

-----------

  There are three types of interpreters:

1) Standalone

2) Concurrent (multiple interpreters that share some data, may run
	       simultaneously with threads)

3) Linked (multiple interpreters that access the same data, only one
	   can run at once, and only switch at safe times)

----------

How the heck should %MY work for private variables? Should it at all?

---------

There are actually three (at least) groups of parameters that need to
be taken independently.

1) The object a method's called on
2) The parameters passed to the sub/method
3) The yield block. (A ruby thing, which is really kind of cool)

---------

Subs need the following bits:

A starting scratchpad pointer
A current entry point (In case the sub's yielded, this is where you
		       start back up)
A default entry point
A stack top pointer to restore (for continuations)
A register frame pointer to restore (for continuations)
Parameter descriptor
JIT/native code pointer
Flags
Bytecode block info pointer

					Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
dan@sidhe.org                         have teddy bears and even
                                      teddy bears get drunk


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About