On Fri, 2007-05-18 at 11:17 +0100, Ben Smith wrote:

> I like the postfix form in Magma: eg
> k := NumberField(u^2 + u + 2) where u is PolynomialRing(QQ).1;

Speaking of Magma .. it's all C code isn't it?
I wonder how a Felix binding to Magma would look?

I think the point here is people, particularly in
different domains, want different syntax for the same
ideas.

A lot of syntax is just term rewriting sugar, so we
want to *enable* this kind of transformation without
necessarily providing it as standard.

I have a mind to represent all the AST terms in
Felix as S-expressions using only a few simple
primitives for builtin literals, plus 'name',
and use the Parser to map arbitrary syntax onto
these kinds of terms.

It may even be possible to then do term rewriting
using a language designed for it, namely Scheme,
since we have OCS scheme available: it's written
in Ocaml, standards compliant, and easy to extend
to add new primitive functions. It may be fairly
easy to add primitive types too, not sure.

The point of using Scheme here is that it is standardised,
known to be reasonably powerful and expressive 
and already implemented. The Felix macro processor
is more Felix dedicated, but it is also harder to
predict what it will do, and the implementation
is made of warts.

Oh, and from the language viewpoint, Scheme is a DSSL.
So we can even sugar the Scheme/S-expressions to be
more 'syntaxful'.

What's more, this presents a readable** text file interface
between parsing and AST manipulation:

        parse, scheme actions --> s-expr
        --> term rewrite -> s-expr
        --> Felix AST terms -> binding

With this kind of design, the front end has two
language independent decoupling points (the s-expr),
so the tools and libraries actually have nothing
to do with Felix.

However the rewrite is very ambitious, and s-expr
lack the type safety the current more rigidly
constructed Ocaml code provides.


-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to