Brooks Moses-3 wrote:
>
> michael.a wrote:
>> It would be interesting for someone to try to make a practical argument
>> that
>> is anything but a nest of technicalities, as to why ctors and unions
>> shouldn't be mixable.
>
> The Fortran language specification allows essentially this, although the
> terms are initializers and equivalences rather than ctors and unions.
> Just this week, I reviewed the patch to add this functionality to the
> GCC Fortran front end, and I wrote a bit of the infrastructure it uses,
> so I can speak somewhat to the problems of implementing it.
>
>
My apologies for saving a response to this post until last... obviously it
is the most substantial contribution to this thread so far.
Brooks Moses-3 wrote:
>
> Now, as for "shouldn't"? I can't speak to that, given that the Fortran
> committee thought it a valuable feature to include, and that we did
> implement it and it works. Well, mostly works, at least -- I wouldn't
> at all swear that we've got all the bugs out of it yet. But it was a
> pain, and it (along with one other feature that required simulating the
> writing of things to target memory) required an amount of effort to
> implement that was dramatically out of proportion to the importance of
> the feature.
> - Brooks
>
I wish I had more to say, but you pretty much covered all of the unturned
bases. It would be very progressive I think if you could make a case for a
similar limited extension of g++. Perhaps __attribute__ type syntax could be
used to aide the compiler for further robustness. In the meantime, I would
very much appreciate it if you could share any specific directions towards
minimally hacking the g++ frontend to let the code through. The way I tend
to use these unions, is always an anonymous union inside a structure. Its
harmless, and dummy constructors can be used and optimized out later. Its
just the error that brings everything to a halt.
I will send you an email or private message if possible before the day is
over.
The system(s) I'm working with are actually extremely interesting. They are
in essence an entirely new "operating system style" environment. Only it
functions like java, in the respect that virtual kernels are implimented for
all platforms, so far that the operating environment itself runs atop your
windows/linuxes/etc, but completely supercedes the presentation while
attempting to build an abstract bridge providing a common shared application
environment utilizing the features of the respective underlying OSes (your
vendor drivers etc) whenever possible, and hopefully emulating when not. The
philosophy of the system is extremely progressive, at the lowest level for
the most part like the best of both the linux and windows experiences...
with completely revolutionary concepts in the command shell, designed to
favor AI, and a completely revolutionary GUI and a universal dynamic program
interpreter able to reconfigure its own syntax and semantics on the fly,
essentially mimicing and intermingling all of your strict programming
languages etc. The initial drive is aimed at independent video game
development, their communites, and their enthusiasts / player bases... and
from there migrating towards a full featured integrated development
environment... and eventually on to more domestic and business oriented
applications. Off course we would prefer Linux as a primary platform, and I
would personally very much like to deliver video games to Linux. If only
because, it is so difficult to imagine Linux ever being the mainstream os of
choice without its share of compatible video games.
In any case its a major development, and I would really appreciate some
special attention towards getting GCC to get the job done for linux wherever
I can find it. Anyone who is interested in helping out towards these ends, I
would be happy to contact, and let them in on what we are doing. A public
release isn't possible without a Linux build. So we gotta get this done, and
there is no room for the core codebase to budge.
--
View this message in context:
http://www.nabble.com/I%27m-sorry%2C-but-this-is-unacceptable-%28union-members-and-ctors%29-tf3930964.html#a11157032
Sent from the gcc - Dev mailing list archive at Nabble.com.