gcl-devel
[Top][All Lists]
Advanced

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

Re: [Gcl-devel] Maxima 5.9 CVS with new GCL successfull buld


From: Camm Maguire
Subject: Re: [Gcl-devel] Maxima 5.9 CVS with new GCL successfull buld
Date: 17 Jun 2002 22:28:04 -0400

Hi Vadim!  Thanks for all your work on this!

"Vadim V. Zhytnikov" <address@hidden> writes:

> This is a multi-part message in MIME format.
> --------------040909030204080001060002
> Content-Type: text/plain; charset=KOI8-R; format=flowed
> Content-Transfer-Encoding: 7bit
> 
> Hi!
> 
> Finally I've got Maxima running with all tests on GCL
> with new packages layout.  The required patch to Maxima
> is attached.  Originally I didn't expect any troubles
> here.  The point is that Maxima 5.9 knows nothing
> about new GCL's packages and uses old USER,
> LISP, SLOOP, SERROR packages.  Since all these packages
> are not touched by new GCL build procedure I expected
> that everything will be just fine.  But it is turned out
> that new CONDITIONS package broke SERROR.  Maxima uses

OK, can you please give me an example of how CONDITIONS breaks SERROR?
Does it make sense to you that it should (i.e. an obvious conflict),
or does it pertain to the way we build the new images? why doesn't
this cause problems when building 5.6 with the new images?

While I think we should definitely chase this one down, I guess we can
always just stick with saved_trad_gcl for building 5.6, but we really
should be able to mix and match with maximum flexibility.

> SERROR only in one place (kclmac.lisp) to define
> ERRSET macro. This macro evaluates expression. If no error
> is signaled it returns result of the evaluation enclosed
> in extra brackets (result).  But if error is signaled
> and value of global variable errset is NIL then it
> returns NIL.  The purpose of the macro is to inhibit
> lisp errors. Maxima uses the following definition
> for errset under GCL (kclmac.lisp):
> 
> (defvar errset nil)
> 
> (defmacro errset (form &optional flag) flag
>     `(serror:cond-any-error (er)
>              (list ,form)
>              ((null errset) nil)))
> 
> This definition relies on non ANSI macro cond-any-error
> which is defined in SERROR.  For other ANSI compliant
> lisps other definition is used (generr.lisp):
> 
> (defvar errset nil)
> 
> (defmacro erst (&rest l)
>      `(cl:handler-case (list ,(car l))
>        (cl:error (e) (when errset (error e)))))
> 

Are we losing anything else in serror that is not replaced in this way
by this equivalent ansi definition?  I.e. you mention losing
functionality -- can you please elaborate?



> The trouble is that as soon as we load new package CONDITIONS
> the former definition for errset stop working as expected.  This is
> sad since some old functionality is broken.  But latter definition
> works fine.  So naturally I've patched Maxima to use second
> definition.  I was surprised to see that second definition of erset
> doesn't work properly under Maxima.  The trouble is that
> (when errset (error e)) always signals error even if errset is set to
> nil.  I don't know yet why (while errset (error e)) works differently
> under GCL and Maxima but I was able to find a workaround.
> I just replaced when by if:

does this make sense to you, or at least sound plausible, that 'when'
should work this way?  Or does it indicate a problem?


> 
> (defvar errset nil)
> 
> (defmacro erst (&rest l)
>      `(cl:handler-case (list ,(car l))
>        (cl:error (e) (if errset (error e)))))
> 
> With such modification Maxima 5.9 builds and passes all tests
> under new GCL.
> 
> Finally some comments on GCL performance.  I've noticed that with new
> GCL Maxima tests run 30% slower. So I decided to make some tests.
> I discovered that if some memory some memory is preallocated then
> difference practically disappears. If I preallocate a lot of RAM
> (about 150MB) then I've got the following numbers on Athlon XP 1700+:
> 
> ratsimp((x+y+z)^100)$ -> 0.11
> ratsimp((x+y+z)^200)$ -> 0.43
> ratsimp((x+y+z)^300)$ -> 1.32
> 
> Timings are exactly the same for both new and old GCL.
> An for comparison CMUCL 18d on the same machine:
> 
> ratsimp((x+y+z)^100)$ -> 0.13
> ratsimp((x+y+z)^200)$ -> 0.72
> ratsimp((x+y+z)^300)$ -> 1.85
> 

Very nice to see these!  Can you suggest some better default memory
settings for typical use that we can hardcode into the initial image?
Also, can one shrink the memory size after it is expanded shold one
desire? 

Take care,


> Best wishes,
> 
> Vadim
> 
> PS: I've commidet the patch to Maxima CVS.
> 
> 
> 
> --------------040909030204080001060002
> Content-Type: text/plain;
>  name="maxima-gcl-errset.patch"
> Content-Transfer-Encoding: 7bit
> Content-Disposition: inline;
>  filename="maxima-gcl-errset.patch"
> 
> diff -uNr maxima-orig/src/kclmac.lisp maxima/src/kclmac.lisp
> --- maxima-orig/src/kclmac.lisp       Mon May  8 10:09:41 2000
> +++ maxima/src/kclmac.lisp    Mon Jun 17 10:22:33 2002
> @@ -1,11 +1,17 @@
>  (in-package "MAXIMA")
> +#-(and gcl ansi-cl)
>  (use-package "SERROR")
>  
>  (defvar errset nil)
>  
> +#-(and gcl ansi-cl)
>  (defmacro errset (form &optional flag) flag
>    `(cond-any-error (er)
>              (list ,form)
>              ((null errset) nil)))
>  
> +#+(and gcl ansi-cl)
> +(defmacro errset (&rest l)
> +   `(cl:handler-case (list ,(car l))
> +     (cl:error (e) (if errset (error e)))))
>  
> 
> 
> --------------040909030204080001060002--
> 
> 
> 
> _______________________________________________
> Gcl-devel mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/gcl-devel
> 
> 

-- 
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]