[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] Re: Brief ACL2 multiple value history

From: Camm Maguire
Subject: [Gcl-devel] Re: Brief ACL2 multiple value history
Date: 25 Feb 2006 12:42:35 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings, and thanks!

So, why was it ever faster to write to a global area than to write to
the global lisp value stack, which is just a C array in the static
area (but also optionally on the lisp stack in an unmoveable place if
one does (si::multiply-stacks...) --  might be able to understand how
this latter case could slow down gc.)?  Just wondering.  Another
possibility is that value stack overflow checking was more complete
and time consuming before ths was implemented.  Now, gcl just relies
on segfault trapping to attempt to detect vs overflow (which is much
faster, but still a bit unreliable).

Take care,

Robert Boyer <address@hidden> writes:

> > Thanks!  I guess what I really meant was -- is there an easy summary
> > of how it worked before?
> Yes.  Instead of returning multiple values, functions simply always returned
> one value, and the return of the "other values" was faked through global
> locations.  This hack was conceived by Bill Schelter as a return value
> implementation even faster than ACKL's multiple value return mechanism.  He
> added a couple of special features to AKCL to make it run faster than in
> plain ANSI Lisp, though a version of it also ran in plain ANSI Lisp.
> Thus in the old scheme:
>   (macroexpand '(mv 1 2 3 4))  => 
>   (LET ((#:G43165 1)) (SET-MV 1 2) (SET-MV 2 3) (SET-MV 3 4) #:G43165)
> and
>   (macroexpand '(mv-let (x y z w) (foo) fap))  =>
>   (LET ((X (FOO)) (Y (MV-REF 1)) (Z (MV-REF 2)) (W (MV-REF 3))) FAP)
> SET-MV and MV-REF reference fixed global locations, in the simplest sort of
> way.  (This makes them perfectly thread-unsafe!)
> Bob
> P. S.  There is now some evidence that even in GCL, using the ANSI return
> value mechanism can be faster than using Schelter's hack of 10 years ago.
> Don't hesitate to inquire further on any detail or matter.  The short story
> is: ACL2 functions used to always return one value (though appearing
> otherwise), and now they return as many as they seem to, if one has done
> (push :acl2-mv-as-values *features*) before the build.

Camm Maguire                                            address@hidden
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]