There was a question how much runtime support is needed to run
Spad code. Here is is a partial answer.
AFAICS "normal" Spad code needs very little runtime support,
basically few macros: SEQ, LETT, SPADCALL and GETREFV function.
Note that "primitive" Spad domains like Integer or Boolean
implement several operations as calls to Lisp macros. So
to realistically run Spad code we probably need few hundreds
of lines of Lisp macros.
SPADCALL itself is reasonably simple, but has serious
consequences: it needs access to domain vector and (via initial
content of domain vector) calls newGoGet function. newGoGet
calls replaceGoGetSlot which given a signature is responsible
to find implementation. To do this it must search various
tables and check condition. This uses large parts of
interop.boot, nrunfast.boot, nrungo.boot and possibly some
other files.
Before we can access domain vectors we need to create them.
Also, domain vectors are needed for types which are used
in first class way (computed at runtime). To create
domain vectors we need mkCategory and Join (and JoinInner)
form category.boot. To fill domain vectors we also need
stuffDomainSlots and few other functions from nrunopt.boot.
The files above in turn need several extra Lisp macros.
So together we probably need 4-5 thousends of lines to
get full runtime support.
One question (that actually got me starting looking at this
im more detail) is if we can write Spad runtime in Spad.
Now SPADCALL is serious problem: to do amost anything we
need function calls, but normally function calls are
compiled as SPADCALL-s, so runtime would go into infinite
recursion trying to resolve calls and fill domain
vectors. However, in principle if all types are known
at compile time Spad compier could generate ordinary
function calls. Such code could run without domain
vectors so we would need just few hundred lines of
Lisp containing primitive operations.
--
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
-~----------~----~----~----~------~----~------~--~---