Skip Navigation

[DISCUSS] IBM using LLMs to convert COBOL to Java

It's not the 1st time a language/tool will be lost to the annals of the job market, eg VB6 or FoxPro. Though previously all such cases used to happen gradually, giving most people enough time to adapt to the changes.

I wonder what's it going to be like this time now that the machine, w/ the help of humans of course, can accomplish an otherwise multi-month risky corporate project much faster? What happens to all those COBOL developer jobs?

Pray share your thoughts, esp if you're a COBOL professional and have more context around the implication of this announcement πŸ™

General Programming Discussion @lemmy.ml

IBM using LLMs to convert COBOL to Java

34 5
103 comments
  • This sounds no different than the static analysis tools we’ve had for COBOL for some time now.

    The problem isn’t a conversion of what may or may not be complex code, it’s taking the time to prove out a new solution.

    I can take any old service program on one of our IBM i machines and convert it out to Java no problem. The issue arises if some other subsystem that relies on that gets stalled out because the activation group is transient and spin up of the JVM is the stalling part.

    Now suddenly, I need named activation and that means I need to take lifetimes into account. Static values are now suddenly living between requests when procedures don’t initial them. And all of that is a great way to start leaking data all over the place. And when you suddenly start putting other people’s phone numbers on 15 year contracts that have serious legal ramifications, legal doesn’t tend to like that.

    It isn’t just enough to convert COBOL 1:1 to Java. You have to have an understanding of what the program is trying to get done. And just looking at the code isn’t going to make that obvious. Another example, this module locks a data area down because we need this other module to hit an error condition. The restart condition for the module reloads it into a different mode that’s appropriate for the process which sends a message to the guest module to unlock the data area.

    Yes, I shit you not. There is a program out there doing critical work where the expected execution path is to on purpose cause an error so that some part of code in the recovery gets ran. How many of you think an AI is going to pick up that context?

    The tools back then were limited and so programmers did all kinds of hacky things to get particular things done. We’ve got tools now to fix that, just that so much has already been layered on top of the way things work right now. Pair with the whole, we cannot buy a second machine to build a new system and any new program must work 99.999% right out of the gate.

    COBOL is just a language, it’s not the biggest problem. The biggest problem is the expectation. These systems run absolutely critical functions that just simply cannot fail. Trying to foray into Java or whatever language means we have to build a system that doesn’t have 45 years worth of testing that runs perfectly. It’s just not a realistic expectation.

  • Im sorta excited for stuff like this to get going in terms of video games. There are some great games and it would be great if it was easier to pull it into a more modern engine or such.

  • Something I found is that LLM struggle with weirder cases, when it comes to code.

    I once tried getting ChatGPT (though admittedly only 3.5) to generate code in understand SaHuTOrEPoL, which is one of the more esoteric languages I created, and it really struggled with it.

    • Probably because it wasn't trained on it. That's not any different from asking the same of a human.

    • I don't think the LLM is gonna do that great of a job with it for this reason, but still worth giving a shot. ChatGPT is a well trained coding chimp. You realistically could get a well trained chimp to start off a lot of projects and have people finish it. The fact that it can correct itself after you explain how it's wrong is very powerful as well.

      LLM isn't gonna be useful for converting a single program from COBOL to Java, it is gonna be useful for converting many programs from COBOL to Java. I bet IBM is trying this on their own shit first before they try to sell it to customers, because language conversion software would be a HUGE but very boom based money.

      • As I stated on a different comment in this thread, I worded my comment poorly. Why I think this is relevant however that, at least in this case, if an LLM get code which is significantly different from what its trained with, it can make wildly incorrect guesses. While here its because of a language with a... unique syntax, I think this could also be the case for code with a lot of technical debt or weird design decisions.

      • IBM hawks new conversion tools all the time. None of them are amazing sliver bullets, all of them require humans to comb over the resulting output. And every single one I’ve ever used chokes on any weird case.

        From the RPG fixed form to free form, DDS to DDL conversion, and so on all of them are usually more trouble to use than to not use.

        IBM does this kind of stuff all the time. And for some folks it’ll work some of the times. But at this point, I just skip any WS tool they put out and have a snippet on RDi and RDz that does all the required plugging away to call web services from the COBOL module.

    • Why would you expect ChatGPT to know how to write code in a language that you created yourself? According to that repository you created it last year, and ChatGPT was only trained on data up to 2021 so there's no way it could have been in its training set. Even though AIs have surprised us with their insights in a lot of cases they aren't magical.

      • Admittedly, I worded my comment poorly. What I meant is that ChatGPT struggled with understanding the semantics and structure of the language.

        As an example, try from this this code block

         SaHuTOrEPoL
            
        $S__ do
        S__-m__w("Hello world!") do
        
          

        You can, hopefully guess that S__ is a variable which has a method m__w, accessed by using a hyphen, rather than a dot and statements end using a do keyword. ChatGPT missed on all marks.

103 comments