Re: Please suggest use-cases for introspective code generation
On Sep 7, 6:18 am, Tony Delroy <tony_in_da...@yahoo.co.uk> wrote:
On Sep 7, 5:30 am, Le Chaud Lapin <jaibudu...@gmail.com> wrote:
I believe the point is simply that debug info is a counter-example
where compilers have that information and encode it in standard
formats (stabs, COFF, XCOFF, DWARF...) for other systems. It would be
possible to compile one translation unit with debug information, have
a code generation utility read the debug information and generate
further code, then compile that code and link it all up, and you'd
have a very clumsy and indirect but functional introspective
capability. The C++ language wouldn't change at all (addressing the
idea you present below)... [snip]
Saying that C++ would not change is like declaring that Hebrew will be
integrated into English, but English will not be changed because
nothing in English will be "touched".
C++ is a human language used to define the form and processes of a
system. If it is to remain true to itself, this definition must remain
context-free, in the collaborative sense, within the minds of
engineers/designers/programmers. The moment any superfluous elements
are added to it, elements that redefine the means by which new form or
new processes are achieved, the language itself has changed. If a
programmer or group of programmers decide to use these new superfluous
elements among themselves, there will arise two distinct languages:
1. The old language - Pure C++
2. The new language - Pure C++ fettered by a requisite pre-compiler.
Users who adhere to "1" and only "1" will be oblivious to fact that
new language has been created and will continue to speak the old
language. Users of "2", no matter how small the group, will have the
option of speaking either language, and will have to make a
commitment, up front, which of language "1" or language "2" they will
use. There will never be a situation where they can continue using
"1" but sprinkle in a bit of "2" occasionally, while essentially
retaining "1". There will only be an extent to the prevalence of "2",
and each test of whether "1" or "2" is being used will be determined
on a highly specific case-by-case basis by the absence or existence of
the superfluous elements. For example, if I add a single C++/CLI
keyword to a 1,000,000 line translation unit, that translation unit
will no longer be C++, because a standards-compliant C++ compiler will
rightfully reject it.
Library design might be language design, but proposals like these
represent language transformations.
-Le Chaud Lapin-
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]