Re: c++ reflection (was (no subject))

Tom Plunket <[email protected]> Sat, 19 Jun 2010 15:16:37 -0700
Newsgroups gmane.games.devel.sweng
Message-ID <[email protected]>
Jon Watte wrote:
>> Have you thought about declaring your reflectable structures outside of
>> c++, then letting your build process create the c++ structure for you as
>> well as any meta-information you like to have in the runtime ?
>
> I think I explicitly said "without code generation" somewhere above in this
> thread.
> I've used extensive IDL and other code generation systems. They have their
> strengths, but also their weaknesses, which have been pretty exhaustively
> listed elsewhere.
> The problem I'm kvetching about here is that the compiler really has all the
> information needed -- it HAS to have it -- but the language and runtime
> exposes no way to get at that information, which unnecessarily hamstrings
> the set of solutions possible while staying within the language.
> Staying within the language is a good idea, because it makes everything from
> dependency checking to source-level debugging easier. Ever tried to debug
> from your source code into the IDL-generated code, only to realize that the
> bug might be in the IDL generator itself, and you can't really "step into"
> or "set breakpoint" in that? That's one of the problems of pre-generation.

What is easier to debug, generated code that is compiled that you can
step through, or expanded macros?

My vote is for the generated code.

Yes, the compiler has the information, and it's irritating that the
language was designed 40 years ago without the consideration that this
sort of data would be useful to make available to the program itself,
but to compare a possibly buggy IDL compiler to possibly buggy macros,
I don't see how you can compare them in the way that you do.  If the
IDL compiler is intrinsic to your build setup (and does not require a
built version of itself to be able to be built itself), then how is
fixing bugs in that any different from fixing bugs in the macro
madness?  They both require inspection of intermediate files, and only
the IDL-based intermediate file can have nice formatting...

-tom!

--
_______________________________________________
Sweng-Gamedev mailing list
[email protected]
http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com