Modern Programming Languages Can Improve Mainframe Productivity and Efficiency

SHARE Email_Blog Images (600x400) (15).png

Thousands of different programming languages have been developed — more are created each year — but not all programming languages are useful for the mainframe, and some have certain functions and limitations. We spoke with Petr Plavjanik, principal software architect at Broadcom, about his SHARE Fort Worth session, “What New Modern Programming Languages You Can Use on the Mainframe?” to gain further insight on the world of programming languages today.

“It is easier to create a new programming language today than it was before,” says Plavjanik. “There is a new programming language almost every week and a lot of the bigger IT companies create their own programming languages.” For example, he says, Apple and Google created their own languages, Swift and Golang, but the most popular languages can be found on indexes like the “Stack Overflow Developer Survey” or TIOBE. Among the most popular programming languages in use today are Python, TypeScript, Swift, Kotlin, Go, and Rust, alongside well-known languages like Java, JavaScript, and C++.

Exploration of Six Programming Languages

As programming languages evolve, they often carry similarities with them from other languages. Plavjanik explains, “Each programming language that has been successful brought something new that others were missing. They are inspired by each other, and many useful features have been added to most of them over time. But there is something unique in each one of them that helped them to gain popularity.”

Python, for example, is popular because it is easy to learn and understand by people who are not professional programmers, says Plavjanik. People can easily automate tasks with it, use it for home projects, or automate software testing. “I have worked with several quality assurance engineers that have not developed any code before and they were able to pick up Python quickly and develop automated tests,” he says. “However, the price for the easiness and flexibility of Python is a relative slowness, so one does not develop CPU intensive algorithms in Python, but develops them in other programming languages and calls them from Python.”

TypeScript added type checks to JavaScript and brought modern JavaScript features to everyone, says Plavjanik. Type checks help you to write better code — especially in large projects — and allow for better integrated development environment features like code completion. However, he says that TypeScript does not replace JavaScript and both can be used in the same project. “Thanks to [the] Node.js runtime, it started to be possible for you to use both TypeScript and JavaScript not just in the browser but also on the server side,” explains Plavjanik. “Although there are a lot of reusable packages for this ecosystem, it is not as mature as in the case of Java or Python.” He adds that there are a lot of programmers that are familiar with JavaScript and TypeScript, but there are not many very experienced developers compared to other programming languages available in the job market.

Meanwhile, Swift has been introduced by Apple as a successor for Objective C for use in developing applications for Apple platforms. “It is a well-designed language, not just for the purpose of developing iPhone apps, and after it was open-sourced it started to be popular to develop server-side applications as well,” says Plavjanik. “As a new language, it has only limited support outside of Apple platforms, but IBM has previously expressed interest in bringing it to z/OS.”

Kotlin is the newest programming language and is similar to Swift in many ways. But it targets environments with JVM (Java Virtual Machine), including Android, explains Plavjanik. “It can be used instead of Java and provides a safer, more powerful, and easier to use language. Java is not bad and it is still improving, but it did appear a quarter of a century ago and has a lot of baggage,” he says. Plavjanik adds, “You do not need to rewrite everything since you can mix Java with Kotlin in the same project.” Google recommended Kotlin as the primary language for Android development last year.

Go, which is sometimes called Golang, takes a different approach. Plavjanik says, “Instead of having a lot of features, it provides a carefully selected set of features. Its main power is simplicity. It is fast to learn, fast to compile, and to execute,” he explains. “It provides a concurrency model that is not based on threads, but goroutines and channels, which is safer to develop in it.”

Rust has won the “most loved programming language" in the Stack Overflow Developer Survey every year since 2016. “It’s designed to be safer to develop in than other programming languages without affecting performance,” explains Plavjanik. “All sorts of memory and concurrency problems are caught by the compiler. It brings a new concept of ownership that prevents a lot of problems at compile time. It takes time to learn it, but it’s worth it. It has an active community but the ecosystem is less mature.”

Availability on z/OS

Not all of these languages are available directly on z/OS, but the Java Virtual Machine has been available for a long time on the platform, which means you can use Kotlin on z/OS without any problems. Node.js has been ported to z/OS and has been supported by IBM for several years, adds Plavjanik. Through Node.js, programmers can use JavaScript or TypeScript on z/OS. Recently, IBM started to support Python on z/OS and Rocket Software has supported Python for years. “This has not happened to Rust or Golang yet, but you can run both of these languages in z/OS Container Extensions,” he explains. “Golang could soon be run directly on z/OS and, until recently, Swift had been supported by IBM on z/OS.”

Best Use Cases

Plavjanik says that Python is an ideal language for the automation of almost anything, including testing. It’s very popular in data science and machine learning. Many projects are started in Python since it’s flexible and it allows you to rapidly react to feedback. Later, the performance-critical components are rewritten in less flexible but more efficient languages, and Python is used as a glue for these components. “That has happened in the case of the Google search engine that has been initially developed in Python,” he explains

Swift is used for developing applications in the Apple ecosystem. “Recently,” Plavjanik says, “Swift has started to be popular for server-side development, especially to develop backend services for mobile applications.”

Kotlin, he explains, can be used everywhere Java is used. Typically, it’s used for backend services for new web applications by companies that are already using Java for previously written applications, as well as for the development of Android applications.

TypeScript has a number of use cases from web applications that run in your browser to backend services in Node.js and desktop applications in Electron. “Its popularity on the backend goes hand in hand with the popularity of Node.js, which provides a lightweight alternative to Java and is preferred by many companies to develop new services for web applications,” says Plavjanik.

Golang is also used for the development of backend services and is often used for system utilities. Many companies rely on it to develop backend services. One well-known project that’s been developed in Golang is Docker.

Rust is considered versatile and is used for applications where stability and performance matter. It is usually used in areas where C++ has been used. Firefox is an example of a project that was developed using Rust.

A Quick Guide to Modern Programming Languages

Programming Language

Strengths

Use Cases

Python

Easy to use, flexible

Automation, rapid-prototyping, machine learning, web applications backend

Swift

Clean, fast, safe

Apps in Apple ecosystem, server-side applications

Golang

Simple design, fast

Server-side applications, utilities

Kotlin

Interoperable with Java

Everywhere as Java

TypeScript

Adds type checks to JavaScript, versatile

Web applications (front-end, backed), desktop applications, utilities

Rust

Safety, performance

Server-side applications, utilities

 

Choose a Language That Improves Productivity and Efficiency

Plavjanik says, “These languages can improve productivity, so long as you choose to review the use cases and choose the language that meets the company’s needs. With a similar use case, you can build on top of existing libraries and leverage existing frameworks and online resources.”

For instance, Plavjanik shared, “In Python and its ecosystem for machine learning, you can quickly achieve outcomes, while in other languages you would have to develop more code yourself.” He adds that TypeScript is an excellent language to use when developing your web UI. Meanwhile, Swift and Kotlin will help you to achieve better productivity than their predecessors Objective C and Java. “They are more expressive and typical constructs can be written in fewer lines,” Plavjanik explains. “Such code is not just faster to write but also to read. They have tried to learn from mistakes and tried to prevent problems like NullPointerException.” Golang is a simpler language than others, which means it can be learned more quickly and be used to achieve benefits earlier. Rust prevents you from making more errors than the rest of the programming languages. He adds that it does take more time to master the language, but you spend less time debugging.

Plavjanik said that when choosing a language, programmers need to take into account the learning curve. “You need to learn the language, the tooling, the ecosystem, and the frameworks for unit testing and typically used libraries,” he says. “Modern programming languages usually come with good tooling, like build systems or package managers. For example, Golang and Rust have these tools as a part of the language distribution itself so everyone uses them.”

“It is good to try the new language on a simpler project and use it for a bigger project after you are more proficient in it,” advises Plavjanik. Software development is a team sport, so it requires a team to agree on the programming language and learn it together. “It’s great if someone has more skills in a programming language and can mentor people who just started to learn it,” he adds. Learning a new programming language is not difficult, especially as today’s popular languages have high-quality training materials — many of which are free — available. Companies often hire people with proficient skills in popular languages who want to improve their knowledge further. “Software developers are creative people who like learning new things, and the desire to master a new programming language is a strong motivation,” says Plavjanik.

However, Plavjanik also warns that it may be difficult to maintain a number of languages down the road, especially if you’re using a different programming language for every project. “It can be difficult to start using a new programming language if the company has a lot of good foundation (such as libraries and tools) that cannot be easily reused with a new programming language,” he adds.

Why choose programming language xyz over COBOL, C/C++, or Java on z/OS?

One of the main reasons is the shorter development time for new applications. It is easier to find developers who already know the modern programming languages or are interested in learning more about them. The benefits of the programming languages, combined with the availability of proven open-source packages and extensions, can improve productivity.

It makes sense to run the application on a mainframe platform, either directly on z/OS, in z/OS Container Extensions, or on Linux on System z because of advantages of the platform in availability, resiliency, security, and the collocation of the data already on the mainframe and the new application.

The application running on z/OS can be a part of a larger solution that can already be based on a newer programming language, and it makes sense to use it for the parts that will be running on z/OS.

IBM is aware of the importance of the interfaces between new programming languages and CICS and Db2. There are packages for Node.js that allow access to Db2 or CICS. There is a Python package for accessing Db2 provided by IBM. Kotlin is based on JVM so existing tools such as Db2 JDBC driver can be used.

In the case of newer languages, such as Golang, there can be a lack of such drivers or packages. It makes sense to consider REST-enabling Db2 and CICS applications and make them accessible from any programming language and platform.

Of course, key factors such as incumbency with a large existing code base, rich functionality which may take longer to learn, and deep integration with the platform bode well for established languages such as COBOL. Fortunately, with the option to build on legacy or innovate with such a range of new languages, IBM Z continues to be an industry-leading platform for all kinds of application development and enhancement.

Recent Stories
Modern Mentoring in Master the Mainframe

Message from SHARE: Ch-Ch-Ch-Changes

Eclipse Che4z: Opening the Mainframe to More Developers