Martin Baker wrote:
> 
> On Thursday 04 Nov 2010 18:25:13 Waldek Hebisch wrote:
> > - in general, changes go much slower than hoped for
> > - in particular Spad compiler needs a rewrite and this goes on
> >   slowely
> 
> Waldek,
> 
> I've been thinking about this over the last week or so. I wouldn't
> presume to understand the issues but I was wondering if it would be
> possible to implement a two stage compiler? I was thinking that the
> first stage would do the pattern matching, so it would take a line
> like:
> 
> myVector * myMatrix
> 
> and convert it to an intermediate form like:
> 
> _*(myVector:Vector DF,myMatrix:Martix DF)$Martix DF
> 
> This intermediate form would be very hard for humans to read but the
> idea is that it could be defined in BNF so that standard tools like
> ANTLR could be used for Lex, Parse, Semantic Analysis and so on.
>

Spad compiler is divided into stages.  Lexical analysis and parsing
are not a serious problem.  Standard tools could help a bit but
actually part that tools can handle is very simple while some
other aspects (like whitespace sensitivity) must be done in
ad-hoc way because tools do not support them.

When one comes to semantic analysis things get more tricky.  First,
when trying to write simple specification of what compiler should
do one quickly sees that desired behaviour is not computable.
So one has to introduce restrictions to turn problem into
computable one (but retain as much as possible from nice
features).  Second difficulty is that currently at some places
the compiler is doing rather strange things, but if one tries
to disable such behaviour the algebra no longer compiles.

Also, there is a saying that real men can do simultanously
several things.  But my experiece is that trying to multitask
slows me down.  When I concentate on one thing, I can do it,
then I can move to another thing.  In the last two years
I spent most of time working on algebra and only a little
on the compiler.

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

Reply via email to