logoalt Hacker News

humblefly • yesterday at 2:41 PM • 7 replies • view on HN

Sincere question: why? Source like this is a notch better than raw decompiler output in the pre-AI era, but what's the expectation / use case?

    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".

Replies

leobuskin • yesterday at 3:28 PM

That's just wrong usage of agents in this project, many models are capable of reconstructing idiomatic and really close to the original source code with a proper tooling and prompting (I mean, you need to understand what you're doing to get such result). It's sad to see this level of reconstruction with all the resources we have available.

alexvas • today at 1:07 AM

I would imagine it would make a good material for AI to learn from.

Given the hardware constraints software engineers had at the time, that code is a piece of art in terms of optimisations. We don't write like that anymore. Now days we optimise for readability and mintainability (rightfully so - optimize later).

Not many people now days can write a complete IDE which can run on a machine with 64 kilobytes of RAM... :)

abalex • yesterday at 3:40 PM

if i have 20 versions of one function to try, i can test all 20 from one script, no DOS. in the Ultima 7 test, all 922 C compiles matched old Borland. ugly code yes, but this part i would use :)

markus_zhang • yesterday at 2:50 PM

I guess AI projects are mostly for individual’s fun. It’s OK.

➕ show 1 reply
ape4 • yesterday at 2:49 PM

Oh, that's basically assembler

➕ show 2 replies
AshamedCaptain • yesterday at 2:49 PM

Is it even better than raw decompiler output? Frankly, I have been saying this forever but always criticized: getting C output that compiles has always been the easy part, getting stuff that is readable is actually where the problem is, and franky these "AI decompilers" are hardly an improvement so far.

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?

➕ show 1 reply
DonHopkins • yesterday at 6:25 PM

It looks that way because compilers are complicated.

If you want to do something useful instead of just whining, then reindent it and submit a PR instead of complaining about something that doesn't matter like white space.