[Aldor-l] [Axiom-developer] Re: exports and constants
Ralf Hemmecke
ralf at hemmecke.de
Wed Jul 26 10:34:33 EDT 2006
On 07/26/2006 03:56 PM, root wrote:
> Ralf, Gaby,
> If you generate lisp from Aldor and parse the result you will have
> complete reflection information.
Well, you are always assuming that the target language is LISP.
The aldor compiler is able to target other languages, too. So I would
prefer a solution that is independent of the target system.
A runtime library would be perfectly OK.
The Trace package in libaldor provides a very limited reflection
http://lists.nongnu.org/archive/html/axiom-developer/2006-07/msg00106.html
If an extension of this package could be provided with the aldor
compiler as a runtime support, that would be better than going the lisp way.
> This can be done dynamically by an aldor domain since you can invoke
> the compiler and get the result. A 'refection' domain could have
> functions to access all of the information available.
Assume you distribute a standalone executable. That will normally not
have the compiler living inside it. So your solution does not work in
that case.
I believe reflections are not too complicated once we know how the
internal datastructures for domains are. (Yes, yes, we must look inside
the compiler sources, or does anybody already have a description of how
domains are represented in memory?)
It would be a bit more complicated to figure out how functions could be
called with the appropriate type. The latter is inherently type-unsafe
and I am certainly not proposing it, but there are cases (like
AldorUnit) where reflection and calling () -> () functions makes sense.
To make it clear, I am only in favour of reflections in order to be able
to write nice programming support tools.
For ordinary users I cannot see an advantage of reflections.
Does anybody else have reasonable use-cases?
Ralf
More information about the Aldor-l
mailing list