20 Years in the Making, GnuCOBOL Is Ready for Industry
GnuCOBOL "has reached an industrial maturity and can compete with proprietary offers in all environments," boasted contributor Fabrice Le Fessant, in a FOSDEM talk.
Mar 15th, 2024 6:22am by
Who Still Uses COBOL?
The COBOL (Common Business-Oriented Language) was launched in 1959, a high-level language primarily to serve the finance and human resources department of large organizations. Now an ISO Standard, the latest version (v 35.060) was posted in 2023. COBOL was the first modern language in one crucial respect: It was designed to be cross-platform. The U.S. Defense Department, which funded the development of COBOL, wanted to get away from the practice of supporting different programming languages for each vendor’s brand of computer. Portability was the key to COBOL’s early success. Although oft-considered a legacy language, Cobol still enjoys LOTS of use, with as many as 80 billion lines of the stuff still out there, one estimate goes. The most amazing part is that it is still growing, by 15% a year. When you use your ATM card, a lot of what happens behind the scenes, when it is not Java, is probably COBOL, said Simon Sobisch, project leader of GnuCOBOL, in the same FOSDEM talk. Many an organization has a voluminous COBOL code base too unwieldy to migrate from. And why would they? It’s fast and reliable. COBOL deployments are now dominated by commercial vendors. IBM bundles COBOL into its mainframes. Micro Focus offers COBOL for PCs. And Fujitsu NetCOBOL runs on both PCs and mainframes. Nonetheless, Sobisch noted that the GnuCOBOL is seeing a lot of commercial deployments, such as for banking back-end apps, many of which are being migrated from Micro Focus, with users reporting performance improvements as a result. The French DGFIP federal agency moved from a GCOS mainframe to GnuCOBOL, with the help of Le Fessant’s firm.‘Hello World’ in COBOL
Originally called OpenCOBOL, the project was started in 2002 and renamed GnuCOBOL in 2013. In the past three years, it has received attention from 13 contributors with 460 commits. Most Linux package managers have a copy of GnuCOBOL for the program for downloading. Below is “Hello World” in COBOL The program is broken into three parts:
IDENTIFICATION DIVISON
PROGRAM-ID. prog
DATA DIVISION
WORKING-STORAGE-SECTION
01 var-string PIC X(20) VALUE "Hello World"
PROCEDURE DIVISION
DISPLAY var-string
END PROGRAM prog
What GnuCOBOL Offers for the Enterprise
Naturally, GnuCOBOL is intuitive to those familiar with the Unix environment. It can compile to C code (C89+), making it extremely portable, from mainframes to Raspberry Pi’s, Sobisch said. There have been implementations of GnuCOBOL code that run thousands of processors, which gave the developers of the project the chance to tune for performance and memory usage in large use cases. Compliance-wise, it passed 97% of COBOL 85 conformance tests, a success rate not yet achieved by proprietary vendors, Sobisch boasted. It’s got 19 dialects, including extensions of IBM and Micro Focus. There’s no support yet for objects or messages in GnuCOBOL. Objects was “a nice feature from COBOL 22, which isn’t used that much,” Sobisch said. Messaging just got reimplemented recently, and is still a new feature for the COBOL crowd to grapple with, Sobisch said. So, no support in GnuCOBOL yet. Also new is SuperBOL, a development studio for GnuCOBOL developed by Le Fessant’s OCamlPro. It runs as a VSCode Extension and features a full COBOL processor (written in OCaml). This software is still in the early stages of development, however. Finally, GnuCOBOL will be one of the languages featured in the upcoming Google Summer of Code, so a whole new generation of coders will be able to say “It’s not just COBOL. It’s GnuCOBOL.”
YOUTUBE.COM/THENEWSTACK
Tech moves fast, don't miss an episode. Subscribe to our YouTube
channel to stream all our podcasts, interviews, demos, and more.