Riccardo GUIDA wrote:
> 
> > You seem to use different terminology.  Spad is language of .spad files.
> > They are intended for non-interactive use -- basicaly enhancements to
> > FriCAS library.  Spad is different than language of .input files.
> > .input files are intended for interactive use.  Now, with "interactive
> > language" there is some confusion, as functions are normally compiled
> > while command line gets special treatment.
> 
> Dear Waldek,
> 
> to explain: my answer relied on the following hypotheses
> 
> * SPAD is the language of .spad files, invoked by )compile

Yes

> * the interpreter =
>    interprets a subset of SPAD language (eg no definitions of domain) on 
> command line and via )read .input files

not "a subset" but rather "a variant".  Once you get to tiny details
it make sense to treat it a a separate language, very similar, but
not identical to Spad.

> + heuristics guesses & coercitions on types
> + SPAD compilation of functions in case of complete type resolutions

No Spad.  Despite the name interpreter is a full-fledged compiler.
It has "interpret" mode for cases where it can not assign
types during compilation and for cases when value is requested.
> 
> ... so naively I thought that, if the interpreter is so unpredictable on 
> types, maybe it was more pedagogical to present things as subsets of SPAD, 
> which is well defined, but now I realize that maybe the examples given maybe 
> do not compile in SPAD, even if embedded in functions of user-defined 
> packages, I do not know, I'm learning using the command line.
> 
> 
> I guess I need some official glossary, could you please enlighten me?
> 
> * How should be called "The language of .input files?"

On the list we usually write about "interpeter".  If you want
to be more precise use "interpeter language".  This is what
FriCAS book calls "interactive language".

> * Is "The language of .input files" the same thing as "the language of 
> command line"?, and if not how is called the latter?
> 

I affraid it is question to philosophers if it is the same or not.
Command line and .input files are handled by the same code (called
"interpreter").  But there is bunch of variables which make
things different.  Main difference is that you can not make piles
on command line.  There is important difference between functions (which
"interpreter" tries to compile) and code outside functions
(which is evaluated to produce a value).

There is pragmatic difference: it is incovenient to define larger
functions on command line, so they are usually defined in .input
files.  OTOH commands (code outside functions) are more useful
on command line.  So pragmaticaly, rules for functions are
more important for '.input' files.  Special handling for
command is more visible on command line.

> * Is the compiler invoked by the interpreter when compiling functions the 
> same compiler (same language) as the SPAD compiler invoked by )compile ?

No.  The first stage, that is splitting input into tokens is
common to interpreter and Spad compiler.  After that Spad compilation
and interpreter are separate.  In particular there are two
different parsers.  Different parsers means that syntax is
slightly different.

"interpreter" has two modes of operation.  In one
it compiles (produces code).  In other it produces values.
As I wrote there is bunch of variables which decides in
which mode "interpreter" operates.

> 
> * Which language is meant by 'The FriCAS language' and 'The FriCAS 
> interactive language'?

Phrase 'The FriCAS interactive language' in FriCAS book refers to
language of '.input' files.  'The FriCAS language' is more fuzzy,
so it is useful for cases when we do not want to specify variant.

Extra explanation: all languages involved are intended to be
compatible, ideally identical.  Historical developement caused
more differences than desired.  To say the truth before your
original message I was happy to accept statement in FriCAS
book about type of one-armed 'if' at face value.  I like
to write well-typed code so I use one-armed 'if' only in
context where 'Void' is right type.  I was not aware that
Spad compiler allowed getting different type. 

-- 
                              Waldek Hebisch

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to