Live data from Hacker News

AI migrated legacy COBOL programs to Java, bugs included

arxiv.org

71–80 of 108 posts

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

#71
post #60

Earlier quoted context omitted.

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 fin…

php has a separate `.` operator that concatenate and you get an error if you try to do it with a `+`. That's indeed better but most of the time you concatenate with `sprintf` anyway

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

#73
This sounds like what the company Mechanical Orchard offers: https://www.mechanical-orchard.com/

Their pitch is like, "we take your COBOL code, and all the real-world data you can give us. Then we model your COBOL program as a graph, where each node has inputs and outputs. Then we use AI to port each node, making sure that it has the same (input => output) mapping for all the test data you gave us."

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

#74

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.

Wasn't COBOL invented to read like business prose and be easily understood by programmers and non-programmers alike? If developers are able to write COBOL code no one understands than it failed its main objective.

IMHO every large software system should be developed on the basis of clear and concise functional specifications so everyone can understand what the software does and how it does so at a higher functional level.

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

#75

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.

Not true, AI does. It's AI job security...

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

#77
post #65

Earlier quoted context omitted.

> 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.

If what you want is the "Why", you're right it probably won't get it right. It'll just give you baseless speculation. But if what you want is the "What" or the "How", I think it can be useful.

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

#78

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.

Wasn't COBOL invented to read like business prose and be easily understood by programmers and non-programmers alike? If developers are able to write COBOL code no one understands than it failed its main objective. IMHO every large software system should be developed on the basis of clear and concise functional specifications so everyone can understand what the software does and how it does so at a higher functional l…

Cobol code isn't esoteric, but it is designed in a way that is unambiguous and clear about its control flow, but very verbose and tedious to read/write. Translating from Cobol to a modern programming language is trivial for LLMs for that reason because the lack of any hidden state functionalities like generics for example.

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

#79
post #39
post #20

How does ai implement all the not Cobol parts a Cobol program rely on? Job Contol, CICS, sort processors? Cobol and mainframe technologies are non existant in java on any modern machine

For the article they just mocked it out for unit tests. But in reality you really can't - that’s a massive pain in the ass. Rewriting pure math is easy, but mocking CICS transaction isolation in java means spinning up these monstrous adapter frameworks that just tank performance

[dead]

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

#80

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 is not deterministic, it will be making tons of mistakes.

Most compilers are also not deterministic, at least by default, but they don't usually make mistakes. Determinism isn't an important quality here. And if it were, AI can be deterministic, it just isn't normally for much the same reason compilers typically aren't (hint: performance).

I find it bizarre that I keep reading this here. Just one of those things that keeps getting blindly repeated without receiving any thought?

Post reply on HN