Project 46: Mixed language programming The topic of mixed language programming, or inter language communication, has in recent years received greater attention than before. This is partly due to the successful acceptance of the high-level languages Ada, C, C++ and Pascal, together with the strong survival of the classical languages Cobol and Fortran. A recent development is Fortran 2003, which has facilities for mixing Fortran and C in a standardized way. This project had been 'dormant' for several years, but it ought to be revitalized. In the meeting in Amsterdam (2023), it was emphasized that the problem still exists, but it was decided to close the project. ----------------------------------------------------------------- Boulder 1981: ============= Einarsson wondered about a TC2 document on mixed language processing, giving a recommendation to manufacturers. Madison 1982: ============= Einarsson considered the investment in working subroutines in Fortran and Algol 60 and the desirability of being able to call them from newer languages. His paper is given in full as document IFIP/WG 2.5(Madison-12)912. Smith remarked that the USING statement in Fortran 8x will permit specification of libraries in a standard way. Ford remarked on the need for a library incorporation mechanism, which has given problems in Algol 68 for NAG and looks like giving problems in Ada. Reid remarked that Fortran 8x allows calls to be routed through interface blocks which may provide a solution to the "separate but dependent" compilation problem; in practice it may mean that the specification and body of a subroutine have to be separated. Rice remarked on the need to standardize descriptions of data structures, in order that they can be passed from one language to another. Dekker felt that the whole interface between languages needed standardization. It was agreed to try to establish a panel discussion on mixed language programming at the 1983 IFIP Congress. A subcommittee consisting of Einarsson, Gentleman and Ford was given the task of trying to arrange it. Smith pointed out that X3 has always encouraged the establishment of communication mechanisms between languages but their plea has always fallen on deaf ears. Soederkoeping 1983: =================== Document IFIP/WG 2.5 (Soederkoeping-11) 1011 is to appear in Software-Practice and Experience. Vouk and Smith agreed to cooperate with Einarsson to follow up with the Department of Energy at Argonne the idea of a workshop on mixed language programming. Pasadena 1984: ============== A "Workshop on Mixed Language Programming" was arranged in conjunction with the eleventh meeting of the IFIP Working Group 2.5 on Numerical Software. Document IFIP WG 2.5 (Pasadena-18) 1118. Sophia-Antipolis 1985: ====================== Report on Mixed Language Programming (MLP) Workshop (Smith) ----------------------------------------------------------- The MLP workshop was held on April 30 to May 2 (2 1/2 days), 1985 in Chicago, Illinois. The workshop was organized by the DOE (Department of Energy, USA) Language Working Group and sponsored by Argonne National Laboratory. There were 42 participants, from Europe, Canada and the United States. Among the participants were members of the IFIP WG 2.5 and the Fortran Standards Subcommittee X3J3. The program is available in this file. The format of the meeting consisted of 14 presentations, organized into 5 sessions with recorded discussion after each presentation and at the end of each session. The topics for the papers included user's views of what mixed language programming capabilities were needed, what suppliers had provided and accomplished, and implementors' views of what has been and could be accomplished. Other presentations discussed experiences with existing mixed language programming environments to develop software libraries and expert systems, and including mixed language programming between languages such as Fortran, PL/1, C, Pascal, LISP, COBOL and Ada. Finally, standardization activities that involved standards for communicating data between languages was presented. The workshop, however, emphasized mainly the difficulties and problems with mixed language programming implementations. Few solutions of a truly general nature (except the VAX/VMS implementation) were presented or developed from the discussion. It become clear that before any truly general solution could be developed, a model for mixed language programming environments and their implementations needed to be created. One suggestion that such an environment was analogous to an asynchronous system with each program in the mixed environment having its own state model was suggested but rejected as inadequate and inappropriate. The meeting is to be summarized in a proceedings to be published as an ANL-MCS technical report. The report will consist of the slides presented during the meeting (or a short paper in lieu of slides) with summaries of the main points discussed after each paper. The proceedings will also contain a summary of the workshop and its conclusions. We plan to publish the proceedings by September 1, 1985. (Note by Bo Einarsson: This never happened) Mixed language programming (Einarsson) -------------------------------------- Einarsson summarized the activities of the ISO Working Group on Programming Language Bindings (TC97/SC22/WG11) and the ANSI X3 Data Interchange Study Group. Einarsson then presented his report IFIP/WG 2.5(Sophia-Antipolis-08) 1208 on the MLP subcommittee, with a proposal regarding standardization of floating point representation using the Type Length Value concept used by the Open Systems Interconnection community. He was encouraged to further develop his proposal and transmit it to the relevant bodies of ISO and ANSI. Argonne 1986: ============= Documents: IFIP/WG 2.5 (Argonne-17) 1317 (1 page), IFIP/WG 2.5 (Argonne-18) 1318, 4 pages. 1319 (5 pages), 1320 (5 pages), 1321 (12 pages). B. Einarsson presented the MLP work and suggestions to ISO described in the distributed documents. Potential use of the TLV representation vs. the "three-integer" presentation was discussed. It was pointed out that some of the floating point number features, such as the IEEE P854 nan's, may not be presentable in the "three-integer" representation, and that TLV approach may be better suited for data interchange among environments. Como 1987: ========== Document: IFIP/WG 2.5 (Como-12) 1412, 2 pages. Einarsson presented his report (1412) on MLP activities in the past year. He noted that the MLP activities seemed to be centered around ANSI X3T2 TC on Data Interchange and ECMA TC 22. It was noted by Rice that PROTRAN is language independent. Stanford 1988: ============== Documents: IFIP/WG 2.5 (Stanford-15) 1515, 19 pages, IFIP/WG 2.5 (Stanford-19) 1519, 1 page. B. Einarsson reported on mixed language programming (MLP) and related OSI (real data types) activities. He outlined the content of the tutorial on MLP he prepared (1515). The paper stresses the importance of MLP, discusses some of the associated problems, and gives a structured view of the various ways to realize MLP. Several examples are given on using FORTRAN subprograms from programs written in Ada, C and Pascal. The paper by J. Bophy, "Use of the IMSL libraries from languages other than FORTRAN", Directions, Vol. 5 (2), 1988, was mentioned for illustrations on mixing of C and FORTRAN. Mixing of language dialects was discussed (Gentleman. Lawson. Vouk. Einarsson). The activities of the ANSI X3T2 committee on "Data Interchange" were monitored by Einarsson and Vouk. Einarsson sent the committee a comment regarding the proposed REAL universal type (1519). Beijing 1989: ============= Document: B. Einarsson, "Application of Mixed Language Programming", Proceedings of SOSS, Beijing, May 1989, pp 27-64. The draft paper presented by Einarsson at the previous meeting was revised and is included in the proceeding of the Symposium on Scientific Software, May 31 - June 3, 1989, Beijing. An expanded version will be presented at the Summer School on Computational Physics of the European Physics Society, Czechoslovakia, September 1989. Jerusalem 1990: =============== Einarsson informed the group that he has been working on grant proposals in the MLP area, and a paper. Vouk is planning a grant proposal in this field. They were both of the opinion that the project should remain open. Oxford 1996: =========== This will remain active and Einarsson will prepare a descriptive paragraph. Cross reference with Fortran/C interoperability. Add Paul to people list. Prescott 2006: ============== This project has been "dormant" for several years. Vouk advocated returning its status to "active". He and other members are involved in related activities and there seems to be a recent renewal of interest in this area of research and, in particular, in the implications for scientific computing. Uppsala 2007: ============= This project had been 'dormant' for several years. Vouk advocated returning its status to 'active'. He and other members are involved in related activities and there seems to be a recent renewal of interest in this area of research and, in particular, in the implications for scientific computing of workflows between different languages involving numerical information. Toronto 2008: ============= Although there was no formal report on this project, several members indicated a continuing interest in this topic and Vouk agreed to update the paragraph describing the focus. Raleigh 2009: ============= Although there was no formal report on this project, several members indicated a continuing interest in this topic and Vouk and Einarsson agreed to update the paragraph describing the focus. Einarsson presented a paper "Standardized Mixed Language Programming for Fortran and C" at the "IFIP Working Group 2.5 Symposium 2009", see also http://www.nsc.liu.se/wg25/mlpcode/ and document 6 below. Mladen Vouk made remarks on Babel, see https://www.llnl.gov/str/Oct06/Epperly.html Leuven 2010: ============ Mixed language programming is getting routine. For example, interoperability between Fortran and C is part of the Fortran standard, and there is good support for interoperability between Fortran and Python. The paper Einarsson presented in Raleigh has now been published, see Document 6 below. Boulder 2011: ============= This project continued to of interest to several members. Interoperability was addressed in the latest Fortran standard and there is interest in developing interoperability with MPI. Paul was dropped from the list of active participants and John Reid was added. Santander 2012: =============== Douglas reported that a related project concerned with "Open Compilers for different Target Languages" is active in this area. Shanghai 2013: ============== Short discussion. The topic is still of interest. Addition by Bo Einarsson: The new book by Markus discusses Fortran interfacing to C in chapter 6: Arjen Markus, Modern Fortran in Practice, Cambridge University Press, 2012, ISBN 978-1-107-01790-0 (Hardback), ISBN 978-1-107-60347-9 (Paperback) Vienna 2014: ============ Members felt that this project should be kept open, but that an updated report is needed. Principal participants associated with this project are encouraged to send information to update the report to Einarsson. Halifax 2015: ============= Report by Van Snyder: An ISO Technical Specification, number 29113, concerning further interoperability with C, was recently completed and published by ISO (Document 7 below). It is incorporated into the current draft of the Fortran standard. The complete description of the current state of interoperability of Fortran with C is now incorporated into Clause 15 of the current draft of the Fortran 2015 revision (Document 8 below). Interoperability between Fortran and C is described in Chapter 10 of "Numerical Computing With Modern Fortran" by Richard Hanson and Tim Hopkins (Document 9 below). The Ada committee (ISO/IEC JTC1/SC22/WG9) has asked van Snyder to assist revision of Subclause B.5 "Interfacing with Fortran" of the Ada standard (Document 10 below). Amsterdam 2023: =============== This is still an open, ongoing problem. Although the project is closed, members will keep an eye on it. Documents: ========== 1. B. Einarsson and W.M. Gentleman, "Mixed Language Programming," Software Practice and Experience, Vol. 14, 384-395, 1984 2. M.A. Vouk, "On the Cost of Mixed Language Programming," SIGPLAN Notices, Vol. 19 (12), 54-60, 1984. 3. B. Einarsson, "Mixed Language Programming Realization and the Provision of Data Types, SIGNUM Newsletter, Vol. 21 (1,2), 2-9, 1986. 4. B. Einarsson, "Application of Mixed Language Programming," Proc. Symposium on Scientific Software, ed. Cai, Fosdick and Huang, Beijing, 27-64, 1989. 5. B. Einarsson, "Application of mixed language programming," Computer Physics Communications, Vol. 61 (1990), 150-162. 6. B. Einarsson, Richard J. Hanson and Tim Hopkins, Standardized Mixed Language Programming for Fortran and C, ACM Fortran Forum, December 2009, Vol. 28, Issue 3, pp. 8-22. 7. ISO Technical Specification 29113, Further Interoperability of Fortran with C, available from ftp://ftp.nag.co.uk/sc22wg5/N1901-N1950/N1942.pdf 8. WD 1539-1, J3/15-007r1 (F2015 Working Document), 29th May 2015, available from http://j3-fortran.org/doc/meeting/207/15-007r1.pdf 9. R.J. Hanson and T. Hopkins, "Numerical Computing with Modern Fortran," SIAM, 2013. 10. Ada Reference Manual, ISO/IEC 8652:2012(E), available from http://www.adaic.org/resources/add_content/standards/12rm/RM-Final.pdf