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

RE: another take on hackers and painters



Steve Dekorte wrote:

> I agree that that is cheating -  it sounds like a language on top of
> Java, and not Java itself. Kinda like saying any turning complete
> language could implement eval.

You'd have to qualify that and say "any Turing-complete language with
reflection or some other kind of meta-information about its objects or
structures".

Without reflection or something to replace it, you can't achieve the same
result.  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.

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.

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.

Anton