COBOL to Kotlin via Formal Models (IR and Alloy and Golden Master)

(marcoeg.medium.com)

28 points | by marcoeg 6 days ago ago

7 comments

  • djoldman 17 minutes ago

    > 1. Both systems run with the same fixed input files (data/accounts.dat, data/txns.dat).

    > 2. Each writes its results to out/accounts_out_*.dat.

    > 3. Python scripts convert fixed-width output to CSV and compute SHA-256 checksums.

    > 4. If the hashes match — behavior is proven identical.

    Step 3 above introduces the possibility that the python scripts alter the output in such a way that the outputs don't actually match prior to the python.

    I'm curious why step 3 is not "If the two outputs match — behavior is proven identical."

  • bigdatajs 27 minutes ago

    The problem I have with all Cobol translation models is that it completely ignores the actual modernization of the system. You've traded one type of syntactic sugar with another.

    • agumonkey 18 minutes ago

      you mean cobol 2002+ revisions ?

  • dfboyd an hour ago

    Isn't the first code sample pasted in there twice?

    • Jtsummers 31 minutes ago

      Yes, starting at:

        STOP RUN.```cobol
      
      Then the code repeats.
  • marcoeg 6 days ago

    I’ve been experimenting with formal, verifiable modernization and taking a small COBOL batch program and translating it through an intermediate representation and Alloy formal model into Kotlin, while proving equivalence with the legacy output.

    Repo: https://github.com/marcoeg/cobol-modernization-playbook

    Would love feedback from people who’ve worked on reverse engineering or legacy transformations at scale.

  • marcoeg 6 days ago