Re: What is the Result from Invoking this Halt Function?

From: Marc Goodman (marc.goodman_at_comcast.net)
Date: 08/18/04


Date: Wed, 18 Aug 2004 04:41:59 GMT

Joe Hendrix wrote:
> You are redefining your claim. You claimed that code proved that
> reflection was possible in standard C (by reflection I mean the ability
> of a program to inspect it's own code at runtime). I merely pointed out
> that your example was not Standard C, so it is not a counterexample.

You're exactly right. The point I was missing was that Standard C
is different from standard C. For me, "standard C" is whatever
compiles with a standard C compiler like gcc and runs on a
standard computer like a PC with Linux. "Standard C," on the
other hand, refers to a programming language standard as spec'ed
out by a standards organization and is an entirely different
kettle of fish.

I acknowledge that you are probably right that there is no method
in "Standard C" to cast a function pointer to an int pointer and
to dereference that pointer. Please take me the last little way
to the end and cite a URL that states this is forbidden/illegal/etc.
I ask this not because I disagree with your point but because
I would like the opportunity to educate myself.

> Obviously, there are languages that support reflection (Java, Lisp,
> Prolog, plus many more), but I suspect that Standard C is not one of
> them and in fact was intentionally designed not to support reflection.
>
> Since any programming language I know supporting reflection is provably
> Turing complete (ignoring resource limits), I don't think this affects
> the halting problem, but that's not really a subject I'm going to post
> anything (else) about.

I agree completely with the last statement. Since it can be implemented
in _non_ standard C, you either have to argue that a PC running gcc and
linux is more powerful than a Turing Machine (which is clearly wrong)
or that adding reflection does not increase the computational power
of the model.

TIA,
-Marc



Relevant Pages

  • Re: What is the Result from Invoking this Halt Function?
    ... >> reflection was possible in standard C (by reflection I mean the ability ... >> that your example was not Standard C, so it is not a counterexample. ... >to dereference that pointer. ... So if you want to demonstrate something that uses introspection on the ...
    (comp.theory)
  • Re: What is the Result from Invoking this Halt Function?
    ... >> reflection was possible in standard C (by reflection I mean the ability ... >> that your example was not Standard C, so it is not a counterexample. ... >to dereference that pointer. ... So if you want to demonstrate something that uses introspection on the ...
    (sci.logic)
  • Re: What is the Result from Invoking this Halt Function?
    ... >> reflection was possible in standard C (by reflection I mean the ability ... >> that your example was not Standard C, so it is not a counterexample. ... The compiler can *technically* ... >> them and in fact was intentionally designed not to support reflection. ...
    (comp.theory)
  • Re: What is the Result from Invoking this Halt Function?
    ... >> reflection was possible in standard C (by reflection I mean the ability ... >> that your example was not Standard C, so it is not a counterexample. ... The compiler can *technically* ... >> them and in fact was intentionally designed not to support reflection. ...
    (sci.logic)
  • Re: What is the Result from Invoking this Halt Function?
    ... >> value pointer much less dereference the result, ... > It doesn't have to be standard C to be possible. ... them and in fact was intentionally designed not to support reflection. ... Since any programming language I know supporting reflection is provably ...
    (comp.theory)