Live data from Hacker News

AI migrated legacy COBOL programs to Java, bugs included

arxiv.org

61–70 of 108 posts

Re: AI migrated legacy COBOL programs to Java, bugs included

#62
post #60

Earlier quoted context omitted.

You can't use BigDecimal either. There are libraries whose whole purpose is just to exactly reproduce COBOL arithmetic, eg. the IBM Decimal Arithmetic Library.

Wow, their Java code example [0] makes COBOL look elegant and terse by comparison. [0] https://community.ibm.com/community/user/blogs/gregory-cerne...

I know it's not the only problem (but it is IMO the main one), but this is why I'm a proponent of allowing operator overloading in languages.

Yes, you can't tell at a glance if `+` really still does what it should, but I find that problem no different from a library mis-naming a function and/or said function having strange side-effects.

`+` should do addition, period. No, not even concatenation if possible (I do find the lack of a separate concatenation operator to be a language flaw --- that said, I understand the use of `+` for concat in libraries targeting languages that offer no alternative).

I think the abuse (especially in C++ ... seriously, allowing overloading of the comma operator? --- and working via bit-shifting streams by ${some_string} bits) gave everyone a bad taste and they kind of threw out the baby with the bathwater.

Re: AI migrated legacy COBOL programs to Java, bugs included

#63
post #5

Earlier quoted context omitted.

sometimes if the bug exists for enough time it is intended behavior

One of the hinges on our front screen door was coming off, the screws were coming loose from the wooden door jam. So I screwed it back on. My wife and son then told me I "broke" the front door. I was confused, I thought I had fixed it Turns out, with the door coming off the hinges, it wasn't closing properly, which meant it was ajar most of the time, so our dog could push it open with her body. Now I'd fixed it, it c…

Ah, the classic load bearing bug.

Re: AI migrated legacy COBOL programs to Java, bugs included

#64

Before, only the senior cobol programmers at the company understood and knew the codebase. Now, no one does. I can see the allure of moving away from a legacy cobol system. But an AI rewrite doesn't actually solve any of the issues with having a legacy cobol codebase. You just have a new system no one knows or understands.

"Now, no one does." well, we just need to learn the rewrite then ???

Yeah, "We are looking for a developer specialized in critical Java code following idiomatic COBOL which hasn't been tested in production yet and which nobody is sure about whether the exact behavior matches what's been running in production. You will enjoy meaningful work in an environment which has been considering engaging in environmental concerns for decades and which caries the well-being and social condition of fellow human beings as a core values, directly addressing your middle age existential crisis. Extra bonus points if you like using LLMs. The pay is good, but remember you are a Java developer, not a COBOL developer, and also remember we are already paying for tokens to do your job. Those are also possibly getting more and more expensive so we'll see about the raises. Job starts as soon as possible."

Re: AI migrated legacy COBOL programs to Java, bugs included

#65

Before, only the senior cobol programmers at the company understood and knew the codebase. Now, no one does. I can see the allure of moving away from a legacy cobol system. But an AI rewrite doesn't actually solve any of the issues with having a legacy cobol codebase. You just have a new system no one knows or understands.

> Now, no one does. I got a chuckle over this, but in my experience working on legacy systems, this is the case already. Using AI to translate/explain the code brings extra understanding.

Can it really explain the code if the information is not there anymore ? It was in a binder that got shredded 40 years ago by accident.

More like it will hallucinate some explanation & cause even more confusion.

Re: AI migrated legacy COBOL programs to Java, bugs included

#66
post #48

Before, only the senior cobol programmers at the company understood and knew the codebase. Now, no one does. I can see the allure of moving away from a legacy cobol system. But an AI rewrite doesn't actually solve any of the issues with having a legacy cobol codebase. You just have a new system no one knows or understands.

Having worked in COBOL extensivly in the 80s and 90s, as well as working for a software house that did migrations (Craziest was Plan assembler to Dec Vax C). I do wonder how an ambitious AI would handle the maths. COBOL is renowed for its fixed no rounding maths, utterly rigid and defined in the code, Java on the other hand is not (e.g., 0.1 + 0.2 becomes 0.30000000000000004), unless they are extensivly using BigDeci…

Aehm we were writing proper math code in Java 15 years ago already.

Your 0.1 + 0.2 example wasn't an issue than and is not an issue today.

Re: AI migrated legacy COBOL programs to Java, bugs included

#67

Before, only the senior cobol programmers at the company understood and knew the codebase. Now, no one does. I can see the allure of moving away from a legacy cobol system. But an AI rewrite doesn't actually solve any of the issues with having a legacy cobol codebase. You just have a new system no one knows or understands.

"Now, no one does." well, we just need to learn the rewrite then ???

The problem isn't as much understanding what the code does (that's hard but not impossible), but understanding why that duplicate INSERT into the database is needed.

The guy who no longer works at the company knew it was because of a bug in the DB that wasn't fixed by the vendor after the company cancelled the maintenance contract due to financial difficulties during the great recession.

AI doesn't and can't know that. So AI proposes to "fix the bug as we port it" and remove the double INSERT. The CTO sends an email saying that the new AI fixed 174 bugs during the porting process and now the company has a much better and resilient system.

BREAKING NEWS: thousands of travelers can't get go back home after thanksgiving due to a computer glitch that accidentally cancelled their return tickets. Stay tuned to our live coverage!

Re: AI migrated legacy COBOL programs to Java, bugs included

#68

Before, only the senior cobol programmers at the company understood and knew the codebase. Now, no one does. I can see the allure of moving away from a legacy cobol system. But an AI rewrite doesn't actually solve any of the issues with having a legacy cobol codebase. You just have a new system no one knows or understands.

Start extracting specs from the codebase.

Prompt the core architecutre well suited for it.

Let it write tests.

Let it vibe migrate from left to write.

Now you at least have a chance of a team being able to work on that code base and actually clean it up and make it good.

Cobold is hard, hard legacy with bad tooling.

Re: AI migrated legacy COBOL programs to Java, bugs included

#69

The biggest problem is not that bugs are migrated with COBOL, but that lots of new bugs are going to be introduced. AI is not deterministic, it will be making tons of mistakes. The only realistic low-error approach is incremental step-by-step migration using Cursor or similar tools. However, it requires much more time as each step must be prompted, tested and committed manually. Any hope that one-shot migraton of a l…

AI doesn't need to be deterministic.

Re: AI migrated legacy COBOL programs to Java, bugs included

#70
post #67

Earlier quoted context omitted.

"Now, no one does." well, we just need to learn the rewrite then ???

The problem isn't as much understanding what the code does (that's hard but not impossible), but understanding why that duplicate INSERT into the database is needed. The guy who no longer works at the company knew it was because of a bug in the DB that wasn't fixed by the vendor after the company cancelled the maintenance contract due to financial difficulties during the great recession. AI doesn't and can't know tha…

nah you just make it hyperbole
Post reply on HN