45 comments
I'm working on something similar though shot of a full decompilation for Microsoft Visual C++, to trace and report the knobs to tune in the internal register allocation algorithm (among other things) to make reversing and decompiling binaries that were compiled with MSVC a much easier task: https://github.com/NoahBPeterson/c2scope
I'm quite far with Microsoft C 5.1, I wonder how much similarity there is, if any.
if((ES_B(_BX,MEMB_FLAGS)&3)==3) {
_DI=ES_W(_BX,MEMB_VALUE);
_ES=SYMBOL_POOL_SEG;ES_W(0,SYM_TYPE)=base;
if(ES_W(_DI,SYM_FUNC_KIND)==2) {
while(!TYPES_COMPATIBLE(TYPE_W(SYM_W(_DI,SYM_TYPE),TYPE_TARGET),TYPE_W(base,TYPE_TARGET),0)) _DI=SYM_W(_DI,SYM_NEXT_OVERLOAD);
} else {
while(!SAME_SIGNATURE(SYM_W(_DI,SYM_TYPE),base)) _DI=SYM_W(_DI,SYM_NEXT_OVERLOAD);
}
if(_DI==0) {_DI=_DI;goto next_param;}
I grant you that it's a thing you can do with agents, and it's impressive that it works, but once the tokens are spent, what does anyone get out of it? I guess I wonder if AI projects are becoming a bit of a "social proof of money spent".But people act as if "well we got something that compiles down to the same binary, this must be the actual C source!" Welp. It couldn't be more different than the original source. In fact, it's probably even distracting if your goal is to reconstruct the original source. This is just AI slop in a form that you can't even easily recognize.
Not to mention the licensing aspect of all of this. One should be wary of Watcom because of its terrible license, even though it is technically Open Source.If as a consequence Watcom is kind of a minefield, I don't even know how to start describing this. The trenches at Verdun?
1. Understanding how the program works. But for this you need a good decompilation, not just "portable assembly in C"
2. Porting to a new platform. Once you have something that builds with a C compiler, you can rebuild it for a different platform, usually more performantly than running in an emulator. And it's often doable (if a lot of work) to also swap out graphics APIs, etc. But I'm not sure there's anyone who would care to run Borland DOS compilers on e.g. apple-aarch64, and DOSbox is more than good enough for anyone who does.
You would introduce new problems.
what is the problem that warrants solving?
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.
Your post has me trying to remember what editor I used way back then...I remember using Turbo Pascal to quickly whip up a multi-hand blackjack simulator after my very first efforts using MS-BASIC and, of course, after my struggles with the incredibly slow interpreted BASIC, Turbo Pascal seemed like straight witchcraft to me.
I can remember being rather blown away by the raw speed of the Borland editor...this had to be the mid 80's or so. Wow...thinking back about how different everything was back then is really taking me down memory lane. The almost instantaneous compile times were also a wonder after cutting my teeth on my University's time-shared DEC/PDP-10 and it's multi-minute waits.
Since no one in my family or my friends were really into PCs (my dad got an original IBM PC for spreadsheet work with Visicalc and then Lotus123), I had almost no way at all to get any information at all about using the editor or even programming in Pascal...I guess the bookstore and the very expensive programming books that I couldn't afford was how I learned. That and a ton of "crash-n-burn" debugging of course.
Sitting in a bookstore taking notes while reading the books...yeah I guess it really was different back then lol.
Borland was well loved by developers, in case you didn't know what it was. You know what happened if there was no AI? the author wouldn't get around doing this rebuilding.
Wouldn't you spend time doing something more productive than dissing someone's effort? Maybe you have something constructive to criticize?
I was thinking what does "recovered" meant, did they dig up an old pile of floppy disk? Given Borland still exist as Embarcadero. And what does "rebuilt" meant,
Reverse-engineered and reconstructed by AI could have been the first sentence.
Read the full thread on Hacker News →
Related stories
- Lobsters · 12 points · over 5 years ago
- Lobsters · 16 points · about 7 years ago
- Hacker News · 1 points · 2 months ago
- Hacker News · 2 points · 2 months ago
- Hacker News · 1 points · 2 months ago
- Hacker News · 295 points · 2 months ago