[RFC] polymorphic arrays

Daniel Kraft d@domob.eu
Fri Aug 6 11:12:00 GMT 2010


Janus Weil wrote:
>> Do you think this would really be useful at a greater scale?
> 
> Definitely. ISO_C_BINDING is an important and widely-used feature of
> Fortran2003. OOP interoperability would be a natural extension of
> this. But maybe we should wait until this gets standardized (assuming
> it will)?!? OTOH, in a compiler framework like GCC which implements
> several OOP-capable languages (C++, Java, F03, ...), it would only be
> natural to share one underlying implementation technique. [I guess
> this comes close to the basic idea of GCC itself: To use one common
> middle-end representation for different programming languages.]

Honestly, to me ISO_C_BINDING is something different than adding a 
complete OOP interoperability with C++; for one, because C is probably 
much more universal than C++ is as target language, and secondly because 
ISO_C_BINDING enables basic interoperability -- OOP stuff is just a 
matter of convenience but you could use ISO_C_BINDING to interface 
between OOP Fortran and C++ also with some added effort.  (But you can 
not do any interfacing without ISO_C_BINDING at all, at least not 
standardized.)

>>  BTW, I think that Java does something like it...
> 
> What do you mean? Are you saying that gcj shares g++'s OOP
> implementation? Or are you talking about the Java language in general?

I think to recall that besides the "official" JNI (Java Native 
Interface) of Sun, the GNU Java compiler did implement what they called 
a "CNI" which basically allowed more or less interoperability between 
real C++ classes and Java ones, at least in a possibly restricted way 
(much more elegant than the JNI).  I did never really use it, though; 
neither did I use the JNI for anything but experiments.

Yousr,
Daiel

-- 
http://www.pro-vegan.info/
--
Done:  Arc-Bar-Cav-Ran-Rog-Sam-Tou-Val-Wiz
To go: Hea-Kni-Mon-Pri



More information about the Fortran mailing list