Re: A new programming language
On Mar 18, 11:48 pm, itaj sherman <itajsher...@gmail.com> wrote:
On Mar 18, 10:05 am, Francis Glassborow
<francis.glassbo...@btinternet.com> wrote:
Not only is there no plan to allow code such as the above to compile in
C++, I cannot imagine that such a proposal would ever get serious
consideration in the future.
C++ is designed to allow separate compilation of translation units.
Using details of a class that have not yet been seen by the compiler
would introduce a nightmare tangle probably worse than goto.
Hmm, I always thought that it would be a good thing, that the
languages couldn't take because it would make compilation more complex
(maybe too complex for the machines of 1980?).
I mean, if the rule was that anything only has one definition
somewhere in the code-base, and the compiler has to look for it for
you (so you don't need any forward declarations).
As for organization in the code, the IDE could work it automatically I
think.
If by "code-base", you mean a code base for the translation
unit, I don't think it would be a problem today. C++ already
allows it in some special cases: within a class, or when
defining an inline function.
It is the sort of feature that works well in small single file programs
but C++ is designed for use across the entire range of program sizes and
separate compilation is an inherent design feature of the language.
And I thought such a feature would actually make it easier to organize
big code-bases. For example, it would save us the horrendeous cases of
ill-formed programs with *no diagnostics required* such as 14.3.3/2.
Instead of the programmer has to do the book-keeping of getting
forward declarations in place, the compiler just has to collect a
database of the single definitions for everything (all partial
specializations in this case) and take them all into consideration (so
no such ill-form cases exist).
Please explain why that isn't just better (as I think it seems to be).
Please explain what isn't just better:-). Seriously, there are
arguments for maintaining the code in a data base, and at least
one compiler does so (or did---I don't know what the current
status is). But it can be tricky, and you have to define the
semantics carefully; you end up having to specify not just a
language, but a build system as well.
--
James Kanze
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]