Mainframe Software3 min read

Why Python on the Mainframe? A Platform Engineer’s Perspective

Greg Spranger
python

If you’ve been around the z/OS operating system long enough, you’ve probably asked: Why bother with Python? After all, the mainframe already has decades of proven languages like COBOL, REXX, and assembler powering mission-critical workloads. Stability and reliability have always been the platform’s strengths.  

But the enterprise technology landscape is evolving, and increasingly that means meeting developers where they already are. Today, that often means Python.  

This blog is the first in a six-part series exploring what it really takes to run Python sustainably on the mainframe. We’ll look at the practical platform engineering challenges behind enabling Python at scale—from managing runtimes and dependencies to building portable artifacts and integrating with modern DevOps pipelines.  

Python Is Everywhere  

Look at the TIOBE Index: Python’s rating ranks highest, doubling C (the next highest ranked language). According to GitHub’s Octoverse report, Python is also the most popular language across open-source repositories. That matters because GitHub is where the global community builds, shares, and collaborates on modern software.  

Why should a mainframe engineer care? Because that’s where today’s innovation lives. Whether it’s advanced data analytics, AI and machine learning frameworks, or modern testing libraries, the richest ecosystem of open-source tools is written in Python. Bringing Python onto the z/OS operating system means we can tap into that ecosystem instead of reinventing it.  

The Next Generation Already Speaks Python  

Python isn’t just popular with professional developers. It’s now the most common first language taught in universities, and in many cases, even middle schools. Entire generations of new engineers are learning to code in Python before they ever touch C, Java, or COBOL.  

That’s not an accident. Python is approachable, with clean syntax and a gentle learning curve. But it’s also powerful, with libraries and tooling that scale from simple scripts to enterprise-grade workloads. Adopting Python on the mainframe lowers the barrier of entry for new talent and makes the platform more accessible to the workforce of tomorrow.  

A Rich Ecosystem of Tools and Integrations  

In distributed development, Python integrates with just about everything: code quality tools, unit testing frameworks, static analysis, CI/CD pipelines, and security scanners. These tools don’t just make developers more productive, they raise the quality and security bar across the lifecycle.  

By supporting Python on the z/OS operating system, we align mainframe development with the same ecosystem. That means better integration with enterprise DevOps pipelines, better visibility into code quality, and a smoother bridge between mainframe and cloud-native workloads.  

The AI Factor  

We can’t ignore the elephant in the room: AI. Hype might dominate headlines, but machine learning and generative AI are living up to that hype–already proving their value in production systems across industries, from anomaly detection to predictive maintenance to fraud prevention.  

And what language dominates this space? Python. The top open source AI libraries, TensorFlow, PyTorch, scikit-learn, are all Python-first. If your enterprise wants to leverage AI and machine learning insights directly on mainframe data, Python isn’t just an option. It’s the on-ramp.  

But Isn’t Python Slow?  

One common objection: “Python is interpreted, so it must be too slow for serious workloads.” Sure, pure Python won’t beat compiled COBOL or HLASM on execution speed. But in reality, there are two kinds of speed:  

  • Execution speed: How fast the program runs
  • Development speed: How fast a team can design, build, and deliver value

Python excels in development speed. It lets teams build prototypes in days instead of weeks. And when performance really matters, Python isn’t boxed in; you can write performance-critical modules in C or even HLASM, exposing them back to Python as optimized extensions. That gives you the best of both worlds: rapid development where speed isn’t critical, and optimized native code where it is.  

In other words: don’t optimize prematurely. Build fast, then tune what matters.  

A Platform Engineer’s Takeaway  

For platform engineers, this isn’t about replacing COBOL or rewriting decades of proven code. It’s about expanding the mainframe’s reach. By enabling Python on the z/OS operating system, we:  

  • Meet developers where they already are
  • Open the mainframe to the largest ecosystem of modern tools
  • Make the platform accessible to new generations of talent
  • Position the mainframe as a first-class citizen in AI and machine learning adoption

Python doesn’t make the mainframe less of what it is, but instead makes the mainframe more connected, more adaptable, and more relevant to today’s enterprise technology landscape.  

Looking Ahead  

This article is just the beginning. In upcoming blogs, we will explore what it really takes to run Python sustainably on a large, shared mainframe environment through a platform engineering lens. We will start with how to support multiple Python runtimes in a way that allows teams to move independently without interfering with one another. From there, we will examine how to manage and govern Python packages at scale so shared systems remain stable and predictable. We will then focus on building and deploying portable Python artifacts that behave consistently across LPARs, and on protecting Python projects from inevitable host evolution so applications remain stable, predictable, and future-proof.  

The series will conclude by turning these principles into practice. We will show how to structure a modern Python project on the z/OS operating system and use practical tooling, including Broadcom’s syncz, to reduce the friction of building and managing Python projects on the mainframe. Rather than prescribing a CI pipeline, the focus is on creating portable, repeatable projects that integrate cleanly with existing enterprise workflows and make the right behavior the default.  

Python is everywhere. And as the center of the enterprise, the mainframe needs a Python ecosystem that’s built to last.  

References  

  1. https://www.tiobe.com/tiobe-index/
  1. https://github.blog/news-insights/octoverse/octoverse-2024/
  1. https://kvia.com/news/business-technology/2022/10/17/anthony-middle-school-teacher-receives-grant-to-teach-python-coding/
  1. https://techdocs.broadcom.com/us/en/ca-mainframe-software/devops/endevor-team-build/1-0/using/the-syncz-synchronization-tool.html