Unofficial Hacker News companion — get notified on comment replies, and more.

Borland's DOS compilers, rebuilt from their own binaries (opens external site)

260 points by frostbyte7 2 days ago | github.com | 95 comments on HN | Vote on HN (opens Hacker News) |

View full thread · View on Hacker News

Comment thread (18)

  1. Can anyone who knows the mainframe domain explain why legacy COBOL applications are not being aggressively ported to modern java applications? It sounds like an obvious usage of AI to solve a real world problem and yet I barely hear about it.
    Replies (7)
    1. There is no problem. If the COBOL code is stable and works, it works.

      You would introduce new problems.

      Replies (1)
      1. This. It's very probable that any system still running COBOL has been relatively stable for decades. A lot of these programs are likely used in relatively risk-averse industries (finance, government, etc.) as well.
    2. You're asking how a watch works!

      The truth is that COBOL, particularly on IBM System/390 and z/Architecture, has some rather unusual data representations and capabilities.

      For example, PIC 9(18) DISPLAY occupies 144 bits! There are also packed-decimal representations (COMP-3), native decimal arithmetic supported directly by the processor, and other specialized representations. Modern Enterprise COBOL even supports decimal fields of up to 31 digits.

      These aren't necessarily exclusive to COBOL or IBM hardware, but the combination of language features, hardware support, and ecosystem integration makes the environment quite distinctive.

      And then there's the ecosystem itself. I'm going to keep this deliberately vague for simplicity, but imagine an airline or a bank with millions of lines of COBOL, deeply integrated with databases, transaction processing, messaging, batch systems, and decades of accumulated business logic.

      Porting that isn't simply a matter of translating source code. You have to preserve behavior, data representations, transaction semantics, and integrations. Verification alone would be an enormous undertaking. You really don't want to accidentally introduce a rounding error into a banking system or break an airline's reservation system.

      Much of this software is also extremely close to the underlying hardware and operating environment. That's part of what makes these systems so difficult to replace.

      Replies (1)
      1. I’ll forward a theory that a large proportion of legacy cobol in actual use is already running in an emulated mainframe environment. Which is only to say that the underlying hardware may not play into it as much anymore.

        I’d be interested to hear from anyone doing work in this field, if I’m right or not. I only have one personal observation, of an IBM system which was still in use in the 2010’s but the TUI was accessed from a web browser and the execution was (reportedly) in an emulator on a modern PC server.

        Replies (3)
        1. Emulators: turns out that the IBM z-architecture is difficult to emulate, all emulators I've tried (zpd&t and other free and commercial ones) have bugs; i.e. "z" has a instructions not available in arm64/amd64 land (i.e. "Load floating-point integer equivalent, rounded" (FIEBRA)); for comparison "z" has 1000-1300 instructions while amd64 has a few hundreds; those therefore need to be rewritten in software, and those implementations sometimes have bugs (I've found many*).

          This is the tip of the iceberg, there are other bugs in the handling of network interfaces, dasds etc. They also have limitations which real hardware do not have. I recommend emulators (free and commercial) for developing, but I'd say, unless you are a hobbyist, stay away from those to run production software; it will work until it breaks.

          (*) Some are not fixed to this day, and I've lost hope that they ever will be.

        2. Good point. Emulators also let you do all kinds of things the original hardware wasn't capable of.

          https://hyperties.org/machine/games/zork/

        3. > running in an emulated mainframe

          IBM has mainframe revenues of $6 billion annually. No need for emulators.

    3. Because Java is much legacy technical debt as COBOL.
      Replies (1)
      1. [citation needed]
    4. > It sounds like an obvious usage of AI to solve a real world problem

      what is the problem that warrants solving?

      Replies (1)
      1. >what is the problem that warrants solving?

        A legacy COBOL code base that runs on expensive and proprietary hardware doesn't sound like a big enough problem?

        Replies (3)
        1. > A legacy COBOL code base

          COBOL codebases are actively updated, maintained, and expanded.

          Instead of wholesale rewrites (which is high-risk), one strategy is adapting a COBOL code base to interact with other cloud software.

        2. It may be a “legacy” code base. But it is probably also very stable and consistent.

          It is quite likely NOT running on legacy hardware though.

        3. This is not true anymore. Most of it can now be emulated as its simply easier to move the legacy application and environment to modern hardware and emulate it.

          Sure there might still be some CNC machine or proprietary interface that exists, but this is so far in a tiny minority that its not economically viable to pay attention to

    5. Why do you think they haven't been rewritten before?

      The code that's still in COBOL is likely mission-critical and must run exactly correctly. The processes it implements are also probably complex enough (e.g. due to the number of workflows and their special cases) that the code is exceptionally difficult or risky to rewrite.

      Even if the amount of labour required to produce the bulk of the code could be cut significantly with LLMs, maintaining correctness (or verifying it) doesn't become trivial.

      You can't vibe the kinds of applications that still run in COBOL.

    6. I don't think the problem is lack of time or desire. It's risk. And I expect all that COBOL does not have robust test suites that an LLM could use to verify it was porting it correctly. And even if it did, the risk of taking down a banking system still probably makes it not worth it. Perhaps someday it will be, though.
    7. > Can anyone who knows the mainframe domain explain why legacy COBOL applications are not being aggressively ported to modern java applications?

      Likely because the legacy COBOL applications are working consistently and predictably, in a controlled context, for unchanged use cases, and making drastic changes to both their own code and the entire tech stack sitting beneath them presents nothing but risk, without any upside.