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

Re: another take on hackers and painters




On Tuesday, May 20, 2003, at 08:21 PM, Anton van Straaten wrote:
> Without reflection or something to replace it, you can't achieve the 
> same
> result.

Sure you can. Just have your "new and improved" compiler retain the 
mate info.

> For example, take C: no matter how fancy an interpreter you embed
> in a C program, it's not going to be able to do anything with C 
> structs for
> which it doesn't have source code or other meta-information.

Right, but what's to keep us from using our interpreter on the whole 
program?

> Java's reflection allows it to achieve essentially the same end result 
> as
> you can in a language with eval, including being able to evaluate 
> arbitrary
> statements in the language which are able to access structures in the
> program that calls eval.

I don't understand what you mean here. Lots of strongly typed languages 
have eval.

> The "cheating" part is that someone has to implement a parser and other
> evaluation machinery in order to achieve this.  But it can and has been
> done, which you can't say of every language.

The only problem I see with doing it in any language is the restriction 
that it work with precompiled code. I agree that reflection is required 
to make that bit possible. But that's not a terribly interesting bit to 
people used to languages which don't require precompilation.

Cheers,
Steve
Io, a small language: http://www.iolanguage.com/