Remix.run Logo
▲ humblefly 5 hours ago

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".
▲leobuskin 4 hours ago | parent | next [-]

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.

▲DonHopkins an hour ago | parent | prev | next [-]

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.

▲markus_zhang 5 hours ago | parent | prev | next [-]

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

▲humblefly an hour ago | parent [-]

I mean, it can also be fun to buy a fast car or spend money on an NFT of a monkey, but we were never celebrating that on HN. Historically, hobby projects on the front page focused on personal growth, practical utility, or a more abstract sense of wonder: "whoa, I didn't know you can do that with a computer".

I guess now, we're to some extent running on "it looks like a thing that would have required skill and determination in the bygone days, but now just requires $1,000, and the author had $1,000".

▲markus_zhang 11 minutes ago | parent | next [-]

I agree with you and I’d not brag about AI vibe coding if I ever did it. But for a lot of people it’s very fun and they are probably the majority.

▲DonHopkins an hour ago | parent | prev [-]

[dead]

▲abalex 4 hours ago | parent | prev | next [-]

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 :)

▲ape4 5 hours ago | parent | prev | next [-]

Oh, that's basically assembler

▲wvenable an hour ago | parent [-]

I wonder how much of the original source was assembler and this is trying to turn it into the C code that it never was.

▲AshamedCaptain 5 hours ago | parent | prev [-]

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?

▲gavinsyancey 2 hours ago | parent [-]

IMO there are two things that decompiling is useful for:

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.