Live data from Hacker News

20 Years in the Making, GnuCOBOL Is Ready for Industry

thenewstack.io

101–110 of 118 posts

Re: 20 Years in the Making, GnuCOBOL Is Ready for Industry

#101
post #78

Earlier quoted context omitted.

> I'd love to know more about why someone would choose COBOL today, if anyone can fill me in. I doubt anybody is choosing to start a new greenfield system in COBOL in 2024. But, if you have an existing COBOL code base, and the business is asking for new features, you have two basic choices (1) write new modules for the existing system in COBOL (2) write the new modules in a more mainstream language (Java, C#, whateve…

TIL, COBOL has been able to make rest calls for almost 20 years: https://stackoverflow.com/questions/52136482/how-can-i-call-...

That link is about COBOL running on IBM CICS. It doesn’t apply to COBOL in other environments (both non-CICS IBM and non-IBM)

But, pretty much every COBOL implementation can do this nowadays, even if the details differ between implementations.

COBOL can call C code, so if have a C library to do something, you can use it from COBOL

Re: 20 Years in the Making, GnuCOBOL Is Ready for Industry

#102
post #93

Earlier quoted context omitted.

Is your org considering transitioning to OpenVMS on x86?

No, TDMS wasn't ported to the Alpha, so migration was never an option.

> No, TDMS wasn't ported to the Alpha, so migration was never an option.

VSI has TDMS for both Alpha and Integrity: https://vmssoftware.com/products/tdms/

I assume they'll probably come out with an x86-64 version at some point

Re: 20 Years in the Making, GnuCOBOL Is Ready for Industry

#103

Earlier quoted context omitted.

The world changes little-by-little, not all at once. Let's say your application (100k LoC of Cobol) handles payroll. Your government introduces some new rules about how paternity leave should be handled. You have two options, rewrite the 100K lines into Java and add the new rule, or just add the new rule in the Cobol app. The latter is cheaper, at least in the long term, so that's what you do. Now you have 101k lines…

One plausible way to rewrite such a program would be to make it more modular. It's already likely all those rules are separated in modules and it is (allegedly) possible to call routines in different languages from COBOL code. You can, then, start writing those rules in Java, Python, C, or Rust (there is a Rust for z/OS!). OTOH, you now have a more complicated and, perhaps, more brittle business-critical application…

> It's already likely all those rules are separated in modules

Have you seen much COBOL code? I had some dealings with a public school budgeting and payroll system back in the 80's, and I can tell you, it was a complete mess, with each program in its own source file (except some COPYs for record layouts). Here's just a simple " example:

COBOL has statements divided into paragraphs, each with a paragraph name. You can have for example, PARA-A down through PARA-D, one after the other. You can say PERFORM PARA-A and it's somewhat like calling a function, where it executes the paragraph and then comes back. Or you can say PERFORM PARA-A THROUGH PARA-C, and that's like calling a function made up of those 3 paragraphs. Or you can fall into PARA-A, and it executes the paragraphs one after the other until a GOTO occurs.

Another completely annoying thing is looping: PERFORM PARA-A VARYING IX FROM 1 BY 1 UNTIL IX > 10 is a for loop. The thing is, the code you execute is somewhere else, maybe 10 pages away. Nowadays there are probably some fancy code editors to help with these kinds of issues, but "back in the day", they were annoying as hell, and how good of a COBOL programmer you were depended on the depth of your mental execution stack.

The main advantages I think COBOL had/has is:

- no memory allocations; you spelled it all out in the DATA DIVISION.

- no various sizes of integers, floats, etc. You spelled it out with PICTUREs, like S99V99 is a signed number with 2 digits to the right and left of the decimal point. That's what it was on every machine.

- no buffer overflows; if you have PIC X(25), the thing is 25 characters, period. You try to move a PIC X(30) to a PIC X(25), and it just chops off the last 5 bytes. You move a PIC X(10) to a PIC X(25) and it pads with spaces. Very simple rules.

Combined, these fairly unique features make COBOL extremely portable.

Re: 20 Years in the Making, GnuCOBOL Is Ready for Industry

#104

Earlier quoted context omitted.

Yes, but you use the REXX to generate the JCL.

Hmm. I guess I am just not seeing the use case but not saying there isn't one. JCL, isn't hard to do. You usually just copy 80% of it from other jobs and change dataset names, etc...

Yes, automatically :)

Re: 20 Years in the Making, GnuCOBOL Is Ready for Industry

#105

Earlier quoted context omitted.

It's the servers that go down! Not the 'frames. Those will go down maybe once a year for maintenance, if that. The mainframe engineers will brag your ears off about that and about the unreliability of the "distributed" systems (a.k.a. servers, a.k.a. what everyone else uses). When you log on to your online banking you're interacting with servers, not with the mainframes directly. The servers are the interface, the ma…

I definitely remember my bank warning me about credit and debit card unavailability, so it's definitely not just the online systems. If cards don't work and the online systems don't work, I don't know what else does. Those maintenance periods usually happen at night, so branches aren't open and wire transfer systems don't work.

I don't know the particulars about your bank, obviously but the thing is, mainframes serve so many millions of clients, and that's clients of the largest money transfer networks (Amex, Visa, Master, everyone really) that if there's an outage it will make the news, internationally, and it will be front page news too. With live updates.

In fact, if I think about it, I don't think I remember any time when a serious outage that was eventually explained in the press was the fault of some mainframe going down. Usually it's something else, like someone misconfigured something or something didn't update correctly etc. stuff that sounds a lot like day-to-day web dev stuff.

So I think maybe it was something else that went on with your bank, that only affected your bank. Like inkyoto says below, maybe some DNS went down?

Re: 20 Years in the Making, GnuCOBOL Is Ready for Industry

#106
post #82

Earlier quoted context omitted.

> I'd love to know more about why someone would choose COBOL today, if anyone can fill me in. I doubt anybody is choosing to start a new greenfield system in COBOL in 2024. But, if you have an existing COBOL code base, and the business is asking for new features, you have two basic choices (1) write new modules for the existing system in COBOL (2) write the new modules in a more mainstream language (Java, C#, whateve…

You're right. I think I misread the original post, and assumed that since they were talking about running COBOL on more modern systems that they were using it to solve new business problems, hence my confusion.

> I think I misread the original post, and assumed that since they were talking about running COBOL on more modern systems that they were using it to solve new business problems, hence my confusion.

Sometimes, a new business problem can be addressed (whether in whole or in part) by changes or enhancements to an existing IT system; in that sense, some people use COBOL for new business problems even in 2024.

Re: 20 Years in the Making, GnuCOBOL Is Ready for Industry

#107
post #81

Earlier quoted context omitted.

The world changes little-by-little, not all at once. Let's say your application (100k LoC of Cobol) handles payroll. Your government introduces some new rules about how paternity leave should be handled. You have two options, rewrite the 100K lines into Java and add the new rule, or just add the new rule in the Cobol app. The latter is cheaper, at least in the long term, so that's what you do. Now you have 101k lines…

I've worked at organisations which have mainframe applications that have been running for almost 50 years. One of the funnier reasons I've heard about why these '100k lines of COBOL' programs never get rewritten is that no one really knows the full extent of what they do, and even if they do know the full extent of what they do, no one really knows the full extent of why . The business requirements that these program…

Heck, I've got code I wrote ten years ago and no idea why it was done that way except for a vague memory of a request that I implemented but was never really used.

Re: 20 Years in the Making, GnuCOBOL Is Ready for Industry

#108
post #55
post #34

Earlier quoted context omitted.

recent scandals with Boeing and United is the result of trump deregulating airlines. https://www.npr.org/2020/12/03/942345240/trump-administratio... a lot of regulation just became "self-certify" and companies obviously cut costs and outsourced everything including fleet maintenance. this article is from 2015 - but things got way worse since then https://www.vanityfair.com/news/2015/11/airplane-maintenance... Europea…

The MAX was certified less than 2 months after Trump took office. He had nothing to do with it.

To Trump's credit he took action against the 737 Max in a timely manner and came out against Boeing as hard as I believe a POTUS could.

Re: 20 Years in the Making, GnuCOBOL Is Ready for Industry

#109
post #45

Earlier quoted context omitted.

The "mathsy" situation can be more difficult than most think. GNU COBOL uses GNU MP by default for calculations, instead of IEEE-754, which came decades later. Not understanding the math of COBOL has led to many failed porting attempts. https://medium.com/the-technical-archaeologist/is-cobol-hold...

"And when you understand how Java does math and how COBOL does the same math, you begin to understand why it’s so difficult for many industries to move away from their legacy." Would it have killed her to tell, how COBOL does the math? I would think that for financial transactions fixed precision arithmetic is used, so IEEE-754 compatibility is irrelevant.

> And when you understand how Java does math and how COBOL does the same math, you begin to understand why it’s so difficult for many industries to move away from their legacy

Java does math the same way as COBOL does math, if you use java.math.BigInteger, java.math.BigDecimal, javax.money, etc

Unlike (say) C++ or C#, Java doesn't have operator overloading, so BigInteger/BigDecimal/etc don't let you use ordinary operators such as + or *, instead you have to use method calls such as add() and multiply()

But, that's not really that verbose compared to Cobol's "ADD ONE TO X GIVING X", etc.

And if you really want + and * with BigInteger/BigDecimal/etc, you can use a JVM language which has operator overloading, such as Kotlin or Java

Re: 20 Years in the Making, GnuCOBOL Is Ready for Industry

#110
post #25

Earlier quoted context omitted.

I'm guessing it does money math in a certain way vetted by this field that would be very difficult to recertify on some replacement.

not the COBOL language, but the IBM mainframes have five nines of availability, duplication of every component, how swappable everything from power supplies to CPU and RAM. Can get to more than five nines if used parallel sysplex, but the big iron is incredibly reliable. This is the reason why all banks, airlines, and other old-school businesses have been running mainframes and cannot ever migrate off of them. this s…

...that wasn't made by Boeing in the last 20 years.
Post reply on HN