2025 · intermediate
The Once and Future COBOL
GCC 15, due for release in May 2025, for the first time includes COBOL among the languages it compiles. Alongside the venerable gcc and g++, there is now gcobol.
The reader may well wonder why a small company would devote years of development to produce a product they don't own and can't sell. The reader might also wonder why GCC decided to include COBOL, and why anyone not retired would care. In short, what use is COBOL?
To those questions and more, we have answers.
As Mark Twain said of himself, news of COBOL's demise is much exaggerated. Industry studies show billions of lines of COBOL still in production. With a probability of 95%, your last ATM transaction went through a COBOL application. Nearly every large firm went through Y2K 25 years ago to add two digits to the date, to adapt their critical software to the 21st century. They didn't do that to throw it all away.
COBOL was and remains useful because it was specifically designed for its problem domain. No language is better suited for nuts-and-bolts unglamorous data processing. For example, COBOL defines an I/O model, numerical precision, 8 forms of rounding, and over 100 runtime exceptions.
Programming languages often have shallow, undeserved reputations. Lisp has too many parentheses, COBOL too many words, Perl is write-only. Let's talk about why COBOL remains viable and vital, and why it's now part of GCC.