9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] Plan 9 on Unix
@ 2001-07-26 17:18 David Gordon Hogan
  2001-07-27 17:52 ` Theo Honohan
  0 siblings, 1 reply; 9+ messages in thread
From: David Gordon Hogan @ 2001-07-26 17:18 UTC (permalink / raw)
  To: 9fans

> > The files for libXg and libframe are not the same in all these three.
> > Also the huygens.org version has the thread library included.
> > Is there an 'official version' for the emulation libs containing libthread
> > and the current version of libXg like thereis 9pm for win32 ?
>
> The huygens (who can pronounce that correctly?) version was put
> together to teach a course on concurrency; that's why it contains
> the thread library.  I think it's a little exaggerated to call these
> emulation libraries, but perhaps not mistaken.  However, there are
> lots more variants, mostly associated with Sam variants, and I'd
> really like someone to clean the mess up (hint, hint).

There's also emu and drawterm (though perhaps unifying _all_ of
these is more trouble than it's worth?  Particularly as Inferno uses
a different graphics model...).



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] Plan 9 on Unix
  2001-07-26 17:18 [9fans] Plan 9 on Unix David Gordon Hogan
@ 2001-07-27 17:52 ` Theo Honohan
  2001-07-30  3:46   ` [9fans] Forth-like Simplifications for Native One-Stack Code Rick Hohensee
  0 siblings, 1 reply; 9+ messages in thread
From: Theo Honohan @ 2001-07-27 17:52 UTC (permalink / raw)
  To: 9fans

On Thursday 26 July, David Gordon Hogan wrote ("Re: [9fans] Plan 9 on Unix"):
>
> There's also emu and drawterm (though perhaps unifying _all_ of
> these is more trouble than it's worth?  Particularly as Inferno uses
> a different graphics model...).

I think Charles Forsyth has hinted here that Vita Nuova intend to
enhance the Inferno graphics model, so I wouldn't count on that
particular obstacle being around forever.  Not that I see demu and
drawterm being integrated any time soon.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [9fans] Forth-like Simplifications for Native One-Stack Code
  2001-07-27 17:52 ` Theo Honohan
@ 2001-07-30  3:46   ` Rick Hohensee
  0 siblings, 0 replies; 9+ messages in thread
From: Rick Hohensee @ 2001-07-30  3:46 UTC (permalink / raw)
  To: 9fans

Forth-like Simplifications for Native One-Stack Code

Rick Hohensee                   July 2001
www.clienux.com

key phrases:
 osimpa, copy-on-write parameter passing, familial variables, subroutine
arrays, compembler, caller-hikes, uniform frames

Commodity microcomputers are one-stack machines, the return stack. This
one stack supports subroutine calls and returns. It is typically further
employed for "local variables" and so on to instantiate the copies of data
routines use so that routines can be reentrant, names can be scoped, and
so on. Data is usually affiliated with a routine by being pushed onto the
return stack before the routine is called. This is usually the province of
a compiler, and the details vary. The nature of reentrance and similar is
such that there isn't a much better way to do these things on
one-stackers, and the issues are independant of implementation language,
if any. The same issues pertain to assembly language, so a bottom-up
approach is to provide these facilities in assembly and see what you get.

There is some mention in the documentation for the BCPL programming
language for the idea of the caller just making the space allocation for
the callee's frame, and leaving the actual data movement to the callee
perhaps. It only takes one instruction to make the space allocation, since
commodity CPUs have thier stacks in memory, and can be indexed, and thus
thier stacks are really arrays. This is the internals of the BCPL
compiler. The same idea can be applied to a "compembler", an assembler
with certain vestigial features of a compiler, which is perhaps the
Forth-like approach. Mechanisms just beyond preprocessor macros in
complexity can be trivially arranged to perform this allocation within a
defined routine. This leaves the populating of the callee's frame to the
assembly programmer. Another simple set of glorified macros can provide a
simple interface to the items in a stack frame. These are normally called
local variables. We just give them stock names. The locals of the current
routine can have lowercase single-letter names. They often do anyway, e.g.
"i", "j" and so on. We can't populate our own stack frame from just our
own stack frame, so we provide access to and names for the items in the
caller's frame. We'll consider the caller to be the parent, and call it's
locals pa, pb, pc... et cetera. We can do the same for routines we have
just called that have returned to the current routine, our children, so we
have ca, cb, cc... We now have enough features that we need to refer to
this system or method by a name. I am calling it "osimpa" at this point.

Osimpa has explicit names for some adequate number of locals in 3 frames,
parent, self and child. Half an alphabet each should suffice, giving about
45 "familial variables". The programmer now may implement copy-on-write
parameter-passing, and given the facilities mentioned so far, that is what
they are most likely to do. Osimpa as explained so far is still just a
compembler though, and any method one prefers to use to shoot one's self
in the foot is available at no crossing of semantic or syntactic borders.

The code I have at the moment for osimpa routine definitions allows the
programmer to specify the size of the hike to be made for it's stack
frame. That code will be going away. While attempting to implement
execution arrays I noticed another advantage of caller-hikes. There is no
time cost related to the size of a stack frame hike. It's one add to the
stack pointer. Subroutine arrays in particular, where each indexed code
section is a normally defined pre-existing routine, make for a compelling
reason to always allocate the same size frame. Using uniform frames
might be a previously unused advantage of caller-hikes.

Give every routine 15 data cells on the stack. This is free, and what a
routine actually uses of that is up to it. If you need more, rethink. This
means each parent generation's data is 0x10 cells above it's child's.
GreatGrandparent's "a" is self's "a" offset by 0x30. More to the point,
having all frames in a system be the same size allows an execution array
implementation that is simple, fast, and meshes well with pre-existing
code.

Consider an array of various osimpa-compembled routine call addresses.
That is, addresses of routines that assume the caller has allocated them a
frame. If they all drop the same size frame on return, choosing which one
to run can be very flexible.

There's two ways to do the choosing. self can jump to an index, and then
the indexed subroutine will return to self's caller, rather than to self.
If self does an indexed call rather than a jump, self or the compembler
has to get the table itself physically out of the way of the program
counter. either way is one instruction on x86.

   2 0003 FF24C3        jmp * (%ebx,%eax,4)
   3 0006 FF14C3        call * (%ebx,%eax,4)


Gone Coding




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] Plan 9 on Unix
@ 2001-07-27 18:35 David Gordon Hogan
  0 siblings, 0 replies; 9+ messages in thread
From: David Gordon Hogan @ 2001-07-27 18:35 UTC (permalink / raw)
  To: 9fans

> I've got a larger and more recent chunk than what the various Sam
> distributions ship with.  The problem I've had, though, is keeping
> things up to date in my not so copious spare time.

This is exactly why pooling our resources is such a good idea.

Could you please hurl your chunk this way?  :-)



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] Plan 9 on Unix
  2001-07-27  3:58 David Gordon Hogan
@ 2001-07-27 14:32 ` William K. Josephson
  0 siblings, 0 replies; 9+ messages in thread
From: William K. Josephson @ 2001-07-27 14:32 UTC (permalink / raw)
  To: 9fans

On Thu, Jul 26, 2001 at 11:58:35PM -0400, David Gordon Hogan wrote:
> I'm actually interested in cleaning the mess up, or at least
> coordinating the effort.  But first I need a more complete
> list of the ``lots more variants''.

I've got a larger and more recent chunk than what the various Sam
distributions ship with.  The problem I've had, though, is keeping
things up to date in my not so copious spare time.

 -WJ



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] Plan 9 on Unix
@ 2001-07-27  3:58 David Gordon Hogan
  2001-07-27 14:32 ` William K. Josephson
  0 siblings, 1 reply; 9+ messages in thread
From: David Gordon Hogan @ 2001-07-27  3:58 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 161 bytes --]

I'm actually interested in cleaning the mess up, or at least
coordinating the effort.  But first I need a more complete
list of the ``lots more variants''.


[-- Attachment #2: Type: message/rfc822, Size: 2071 bytes --]

From: "rob pike" <rob@plan9.bell-labs.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Plan 9 on Unix
Date: Thu, 26 Jul 2001 10:13:11 -0400
Message-ID: <20010726141313.8013F19A38@mail.cse.psu.edu>

> A question about the unix plan9 emulation library
> Searching the net i found it in the following places
> 	www.cse.psu.edu/~schwartz/software.html
> 	www.huygens.org/~sape/concurrency
> 	www.netlib.org/research
>
> The files for libXg and libframe are not the same in all these three.
> Also the huygens.org version has the thread library included.
> Is there an 'official version' for the emulation libs containing libthread
> and the current version of libXg like thereis 9pm for win32 ?

The huygens (who can pronounce that correctly?) version was put
together to teach a course on concurrency; that's why it contains
the thread library.  I think it's a little exaggerated to call these
emulation libraries, but perhaps not mistaken.  However, there are
lots more variants, mostly associated with Sam variants, and I'd
really like someone to clean the mess up (hint, hint).

-rob

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] Plan 9 on Unix
@ 2001-07-26 17:39 Scott Schwartz
  0 siblings, 0 replies; 9+ messages in thread
From: Scott Schwartz @ 2001-07-26 17:39 UTC (permalink / raw)
  To: 9fans

Rob says:
> ... I'd really like someone to clean the mess up (hint, hint).

I feel the same way.  :-)



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] Plan 9 on Unix
@ 2001-07-26 14:13 rob pike
  0 siblings, 0 replies; 9+ messages in thread
From: rob pike @ 2001-07-26 14:13 UTC (permalink / raw)
  To: 9fans

> A question about the unix plan9 emulation library
> Searching the net i found it in the following places
> 	www.cse.psu.edu/~schwartz/software.html
> 	www.huygens.org/~sape/concurrency
> 	www.netlib.org/research
>
> The files for libXg and libframe are not the same in all these three.
> Also the huygens.org version has the thread library included.
> Is there an 'official version' for the emulation libs containing libthread
> and the current version of libXg like thereis 9pm for win32 ?

The huygens (who can pronounce that correctly?) version was put
together to teach a course on concurrency; that's why it contains
the thread library.  I think it's a little exaggerated to call these
emulation libraries, but perhaps not mistaken.  However, there are
lots more variants, mostly associated with Sam variants, and I'd
really like someone to clean the mess up (hint, hint).

-rob



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [9fans] Plan 9 on Unix
@ 2001-07-26  8:11 Anastasopoulos S
  0 siblings, 0 replies; 9+ messages in thread
From: Anastasopoulos S @ 2001-07-26  8:11 UTC (permalink / raw)
  To: 9fans


Hi

A question about the unix plan9 emulation library
Searching the net i found it in the following places
	www.cse.psu.edu/~schwartz/software.html
	www.huygens.org/~sape/concurrency
	www.netlib.org/research

The files for libXg and libframe are not the same in all these three.
Also the huygens.org version has the thread library included.
Is there an 'official version' for the emulation libs containing libthread
and the current version of libXg like thereis 9pm for win32 ?

Spyros




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2001-07-30  3:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-26 17:18 [9fans] Plan 9 on Unix David Gordon Hogan
2001-07-27 17:52 ` Theo Honohan
2001-07-30  3:46   ` [9fans] Forth-like Simplifications for Native One-Stack Code Rick Hohensee
  -- strict thread matches above, loose matches on Subject: below --
2001-07-27 18:35 [9fans] Plan 9 on Unix David Gordon Hogan
2001-07-27  3:58 David Gordon Hogan
2001-07-27 14:32 ` William K. Josephson
2001-07-26 17:39 Scott Schwartz
2001-07-26 14:13 rob pike
2001-07-26  8:11 Anastasopoulos S

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).