[Aldor-l] Name constancy in type context and lazy evaluation

Martin Rubey martin.rubey at univie.ac.at
Mon Nov 6 07:18:47 EST 2006


Dear Christian,

I guess I was too quick with my first answer. I have to confess that I don't
really know what "_arbitrary_, _recursive_, parametric types" are. What I really
want is, I think, what is mostly doable in Aldor anyway, i.e.,

A: SomeCat; B: SomeCat;
A == f(A,B) add;
B == g(A,B) add;

or, rather

l := [SomeDomain, SomeDomain];
l.1 := f(l) add;
l.2 := g(l) add;

I think that the difference between these too should not be so big as to be
impossible to overcome. By the way, would you say that name constancy holds in
the first snippet?


"Christian Aistleitner" <tmgisi at gmx.at> writes:

> >> Are there languages, where you can create _arbitrary_, _recursive_, parametric
> >> types (I know that Aldor does not have parametric types ;) ) smoothly at
> >> runtime?

> > As far as I know, ANSI Common Lisp allows that...

> I'd be suprised to see that something like that working. Can you give an
> example and demonstrate arbitrary, recursive, parametric types in Lisp?

No, sorry. I just guessed, given what I know about Common Lisp and what I did
in grammar. 

> >> > Do you agree? Or do you think that the current restrictions are
> >> > necessery/sensible?
> >>
> >> Sadly enough, I guess it's a very natural restriction. I guess, there are
> >> several workarounds (even for Aldor) if you just need certain kind of
> >> recursions, but for your grammar parsing code, you want the whole thing.
> >> And it means lots of troubles to get this working in a compiler.
> >
> > Do you know about the troubles involved? I'd be interested to hear more
> > about that!
> 
> Let me relate the problem to the fixed point problem in mathematics:
> 
>     x = f(x)
> 
> . Assume Times, Plus and these things are hidden within the f.  You need the
> exact solution (No fuzzy domains). So no iteration schemes.

I don't know what an iteration scheme is...

> Furthermore, you have no knowledge about f, other that it's a mapping from
> the reals to the reals (The domain building function can be _any_ domain
> building function).  You can evaluate f only once. 

Why?

> And for that evaluation x = f(x) has to hold 

That's impossible, of course. But I don't see the relation to the problem at
hand.

> (No side effects from superfluous domain building).  And you have to solve
> the problem for all possible values of f (Any domain building function should
> be usable).
> 
> That's hard/impossible for CAS. But the Aldor compiler is not a CAS. It  does
> not have _any_ computational strengths.
> 
> What would you do if there is no finite fixed point?
> E.g.:
>    X == List( X );

recurse to infinity, as soon as I try to use X.


Martin




More information about the Aldor-l mailing list