Remix.run Logo
▲ natas 2 hours ago

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.

▲Jolter an hour ago | parent [-]

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.

▲natas 42 minutes ago | parent | next [-]

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.

▲DonHopkins 38 minutes ago | parent | prev | next [-]

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

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

▲LeFantome 14 minutes ago | parent | prev [-]

> running in an emulated mainframe

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