This article is more than 1 year old
Cloudflare goes retro with COBOL delivery service. Older coders: Who's laughing now? Turns out we're still vital
Dust off your COBOL code and give it new life in WebAssembly
Network infrastructure biz Cloudflare has implemented a way to run COBOL code on its serverless platform Cloudflare Workers.
COBOL, 60 years old this month if you start at the publication of the US Defense Department's April 1960 software specification, is short for COmmon Business Oriented Language.
Work on the programming language began in 1959 and the first COBOL code was deployed in 1960. Within a decade, COBOL had become the most widely used programming language in the world at the time, and it has proved surprisingly resilient.
The software was designed to be machine-independent and easy to use, so that government organizations and businesses could run data processing jobs on diverse hardware. It was also disparaged by some computer scientists for its lack of academic pedigree.
Despite its age, COBOL is still in use and COBOL programmers are still in demand, particularly given the impact of the COVID-19 pandemic on government agencies with legacy IT systems.
Connecticut Labor Commissioner Kurt Westby on Wednesday recounted the "hundreds of hours of programming" that have gone into modifying his state's unemployment claims system, which runs on 40-year-old hardware, to handle the surge in COVID-19 claims. And earlier this month New Jersey Gov. Phil Murphy put out a call for COBOL programmers to prop up that state's aging mainframes.
And a Missouri-based IT biz FairCom on Thursday said it is offering COBOL modernization services for non-mainframe COBOL systems for free for a year to government agencies, because of the burden COVID-19 has placed on those systems.
A source of amusement...
"COBOL is often a source of amusement for programmers because it is seen as old, verbose, clunky, and difficult to maintain," wrote John Graham-Cumming, CTO of Cloudflare, in a blog post.
COBOL-coding volunteers sought as slammed mainframes slow New Jersey's coronavirus responseREAD MORE
"And it's often the case that people making the jokes have never actually written any COBOL. We plan to give them a chance: COBOL can now be used to write code for Cloudflare's serverless platform Workers."
COBOL is a compiled language, so it can be converted to WebAssembly, which allows the instructions to run on Cloudflare Workers.
Using the GNUCobol project, you can compile COBOL code to C and then use Emscripten to compile the C code to WebAssembly. Cloudflare offers a tool called cobaul to simplify this process.
Deploying a COBOL Worker involves installing wrangler, a tool for setting up Cloudflare Workers, on a local machine.
You then run the command:
wrangler generate cobol-worker https://github.com/cloudflare/cobol-worker-template
That creates a directory named
cobol-worker with the Worker code. Cloudflare account configuration instructions get printed to the terminal.
After that, the worker can be deployed with the command
npm run deploy.
To get a sense of the possibilities of COBOL, Cloudflare has a Paper, Scissors, Rock demo. ®