axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] Re: noweb / Lisp Skills


From: Ralf Hemmecke
Subject: Re: [Axiom-developer] Re: noweb / Lisp Skills
Date: Fri, 05 May 2006 13:05:04 +0200
User-agent: Thunderbird 1.5.0.2 (X11/20060420)

On 05/05/2006 11:59 AM, Martin Rubey wrote:
"Page, Bill" <address@hidden> writes:

On Thursday, May 04, 2006 10:47 AM Martin Rubey wrote:
... Things to do on the interpreter side needed for the axiom-combinat project:

* make it understand Aldor:

  * dependent types
  * extend
  * creating domains on the command line

Is what you are suggesting the same thing as making library
programming possible at the level of the interpreter?

Yes. In aldor -gloop this is possible.

In fact, maybe it would be better to try to integrate the type guessing
mechanism of Axiom into the Aldor interpreter. That is, throw away the axiom
interpreter and replace it by aldor -gloop.

Hmm, I am not sure whether I would currently suggest "aldor -gloop" as a
replacement for the Axiom interpreter. The idea that the interpreter and
compiler languages are identical is attractive, but

1) "aldor -gloop" is slow and needs something like BNatural to make Aldor
simpler for endusers. But it might be a good start in the long run.

2) The aldor interpreter seems a bit buggy to me.

If so, they I supose that you realize that this is already an issue at the
level of SPAD and is not really an Aldor specific problem. It seems to me
that the differences between the interpreter and library compiler
environments were largely built-in as part of the original design of Axiom. I
think the designers decided that the interpreter *should* behave differently
than the compiler and that some of the things the compiler does should
specifically not be available to the interactive user.

If this was intentional, it was a mistake.

I also think that. The interpreter should actually be a shell around the compiler and the libraries. One could even have several such shell similar to csh, bash, etc. (The question is whether different shells/interpreters would be desirable.) In particular, if an interpreter allows to read something like .input files (that are interpreted like the command line) than one cannot expect to get easy translation of .input to .as since the interpreter might have added automatic type coercion. The extreme would be that only pure Aldor (.as) files are allowed. But though it might be tempting to force people to think about the types they actually want, it would probably be much to hard for beginners. One has to get used to all this type stuff.

But the the 'extend' functionality is another issue because that whould
require providing the equivalent of the library compiler at the interpreter
level.

Yes, this might have been wrong on my side. It seems that extend does not even
work in aldor -gloop. However, I think it should.

Currently the Axiom interpreter can call the compiler and thus extend (well, not the Aldor "extend") the functionality of Axiom per session.

What would people think about a (library) function "compile" that takes a string as input (or better something of type "AldorCode" and considers this to be aldor code that has to be compiled. The result would be the compiled function that then can be used as any other function. So one would say something like

f := compile(Integer -> Integer, "(i:Integer): Integer -> i+1")
n: Integer := 2;
f(n);

Of course I could write this without the quotes, but imagine that the string has been dynamically produced by a program.

Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]