Python, C, C++, and Fortran Relationship Status: It’s Not That Complicated
summary
Clear actionable claims: three practical paths — wrap / extension / embed — with concrete pros and cons; tools that actually work include ctypes (no C++), cffi (parses headers), f2py for Fortran, SWIG (ambitious but can mismanage ownership), boost.python, and cython (compiles Python to C and speeds numeric code with numpy). Examples show ctypes passing by reference to Fortran, cython emitting C then compiling, and embedding pulling a Python interpreter into an executable; xdress for automated cython bindings appears stalled.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 3:53Python's C API
- 8:26Connecting Python with C/C++/Fortran
- 15:54Foreign language tools
- 21:29Wrapping C++ with Swig
- 24:45Cython performance
- 29:43Summary
- 30:49Q&A
related talks
01h 01mExtend and Embed Python with C++
25mHow to bring your C++ project to Python land
32mFrom Fortran to Python: A Conversation Across Generations of Scientific Computing
06mLessons learned from using the C Foreign Function Interface
36mIntroduction to C++ python extensions and embedding Python in C++ Apps
29mC++ ♥ Python: from modules to hybrid applications
31mCFFI, Ctypes, Cython The Good, The Bad and The Ugly
29mThe Art of Extending Python with other languages
