logoalt Hacker News

humblefly • today at 2:41 PM • 5 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 • today 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.

abalex • today 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 • today at 2:50 PM

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

ape4 • today at 2:49 PM

Oh, that's basically assembler

AshamedCaptain • today 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?