Martin Rubey wrote:
>
> Dear Waldek,
>
> Gabriel Dos Reis <[EMAIL PROTECTED]> writes:
>
> > OpenAxiom now uses proclamation at the generated Lisp level to try to catch
> > problems, and also for optimization purposes (in particular for SBCL-based
> > builds). This means that `pretend's like above (which really violate data
> > representation description) are caught at runtime.
>
> as far as I can tell, this optimization is orthogonal to the optimization I
> pushed through. Maybe we could integrate it?
>
> For your convenience, here is what I believe to be the main routine (from
> c-util.boot).
>
1) AFAICS this routine needs a bunch of other routines.
2) I belive that proclamation have very little effect on speed of
Spad code. Namely, most calls in Spad code are indirect and
in particular calls to functions in different files are indirect.
Inside a single file compilers can reasonably well discover
signatures, so proclamations give little help. One could
expect more gain in Boot code, where there is a lot of direct calls
to routines in different files. However, my experiments indicate
that using interp-proclaims.lisp with sbcl (which required fixing
some problematic proclaims) have very little effect.
3) Nice thing about proclamations is that they can catch some bugs.
But to get significant gain one would have to push more type
information from Spad to Lisp. However, I am affraid that
pushing type information to Lisp declarations is not the way
to go. Namely, type system in Spad is quite different and in
many cases we will have to use T as corresponding Lisp type.
Also, we may get trivial type violations:
(prog (x)
(declare (fixnum x))
(setf x 0)
....
Since we assign fixnum to x morally this snippet is type correct.
But according to Lisp rules x is initialized to NIL, which is not
a fixnum, so we get type error. AFAIK similar things are common
experience when trying to generate "typed" code.
--
Waldek Hebisch
[EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/fricas-devel?hl=en
-~----------~----~----~----~------~----~------~--~---