Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28632 Discussions

Mixed Programming Language: C, C++ or VB?

jq2000
Beginner
516 Views
I am working on my first Fortran based mixing language project in Windows. I choose using C this time, because of following reasons:
* There are more reference sources about C-Fortran mix
* Fortran and C have more common functionality. They share the same system calls in Unix and easier to communicate each other seamlessly. I guess it is similar in Windows environment.
* A software which my project will integrate into is Fortran-C mix, except user interfaces of VC++.

I would like to try different way next time. I hope experts in this forum could provide general information about comparison between different languages mixed with Fortran.

Some extra questions:
* C and C++, which one is better to combine with Fortran?
* C/C++ and Fortran share the same developing tool, VC++ or CVF. Is it possible to add a VB project into the workspace of VC++/CVF to mix Fortran, C, VB together, even edit and build VB directly there?
* Any advantage to use C# with Fortran?
* Can Fortran mix with Java and other languages?
0 Kudos
1 Reply
Steven_L_Intel1
Employee
516 Views
I somewhat disagree with your reasons for picking C, though not the choice. If Fortran and C seem to "share the same system calls", it is by vendor extension and not inherent to the language. But I'll agree that there is a lot more written about interfacing with C as compared to C++.

Pick the language that makes the most sense for your application. C and C++ are the easiest to mix with Fortran, but VB is close behind. VB can't share a project or the development environment with C/C++ and Fortran. You can use Java, see this newsletter article.

C# is a bit tougher - I would avoid that for now unless you had a real need for it.

Do make sure you read the Programmer's Guide chapter on mixed-language programming and look at the various samples provided.

Steve
0 Kudos
Reply