The programming languages Fortran, C, C++, and Python each have their strengths and weaknesses and their own fan base. This workshop is for people who would like to be able to combine these languages within one code project:
The goal of this lesson is not to become expert in pybind11 or Python CFFI but to get you on a good track with simple but working examples which can be adapted to your domain.
To appreciate the material it helps to have some previous exposure to Python and a compiled language (C, C++, or Fortran).
This lesson is tested on Linux and Mac. It should be possible to get it to run on Windows but tweaks are then necessary.
13:00 | Motivation | Why is one programming language often not enough? |
13:10 | Overview over different approaches | Which tools are out there? |
13:15 | Hands-on example using pybind11 | What tool do you recommend to interface Python and C++? |
13:40 | Fortran, C and C++ talking to each other |
How can we couple Fortran with C/C++?
What is name mangling? How can we avoid worrying about it? How can we safely pass data types across languages? |
14:00 | Using the C Foreign Function Interface for Python |
Is there a non-intrusive way to couple C/C++/Fortran and Python?
Can I test my Fortran code with Python? |
14:35 | Finish |
14:35 | Memory allocation for arrays that pass the API | Where and how should we allocate memory? |
14:45 | API design |
How can we create composable code units?
How can we improve the API to make it easier to understand and use? |
15:05 | Roadmap for migrating and modularizing legacy code | Big untested legacy monolith code in front of you - what now? |
15:15 | Finish |