nativegate
← Blog

f90wrap vs nativegate: Python interfaces vs a full modernization workflow

f90wrap deserves the same respect here that F2PY got in the previous comparison. It's a maintained, widely used generator for Fortran-Python interfaces, and it handles territory nativegate treats narrowly: derived types and type-bound procedures, wrapped into Python classes rather than flattened into argument lists. If your modern code is module-heavy with an object-shaped surface, f90wrap speaks that dialect better than we do today.

Where the scopes genuinely differ

f90wrap answers: "how do I call this Fortran from Python?" It stops, correctly, at a high-quality extension module. What happens around that module — the build system, the wheel, the tests, the evidence the numbers didn't move, the deployment — is the same story as with f2py, and it's where nativegate's scope begins.

Capabilityf90wrapnativegate
Fortran → Python bindings
Derived types → Python objectsnarrow (scalar components, module-contained types, free-form source)
Type-bound procedures
Modern modular Fortran (F90+)
Legacy fixed-form F77 decks with inferred intent
Generated CMake build + installable wheelyour job
Generated pytest suite + golden-record numerical regression
Generated FastAPI service
Docker image + Kubernetes manifests
C++ support via pybind11

The trade in one sentence

f90wrap wins the benchmark it exists to win — faithfully wrapping modern, modular, object-shaped Fortran. nativegate wins when the phrase "Fortran to Python" is the beginning of a project rather than its end, and the remaining work is packaging, deployment, organization.

Compatibility notes worth stating plainly

  • nativegate's derived types require the type defined in the same file, all-scalar components, a subroutine inside a module, and free-form source. Outside those boundaries, we'd rather refuse with a stated reason than guess — f90wrap is the better tool for general derived-type work.
  • Fixed-form F77 decks — 1980s–90s code with INCLUDE chains, COMMON blocks, and no INTENT declarations — is where f90wrap wasn't headed and where nativegate's parser does its heaviest lifting.
  • Nothing stops the two from coexisting: f90wrap for a well-typed modern module inside a bigger project, nativegate for the ancient deck nobody wants to touch but everybody needs.

The honest bottom line

Pick f90wrap if your goal is "Python code that uses this modern Fortran library." Pick nativegate if your goal is "this legacy system lives behind a modern, verified, deployable interface." Both goals are legitimate, and the tools cross-promote each other's boundaries more than they compete.

See what nativegate generates → Also see: F2PY vs nativegate