• Semperverus@lemmy.world
    link
    fedilink
    English
    arrow-up
    10
    arrow-down
    1
    ·
    5 months ago

    You can kind of do this now. The problem is that variable names and debugger info is lost, so you wind up with all variables and functions being named v1, v2, v3, etc and f1(), f2(), f3(), etc.

    Decompilation is totally a thing

    • matjoeman@lemmy.world
      link
      fedilink
      arrow-up
      17
      ·
      5 months ago

      Right but I assume the parent meant that the AI could guess what the original function and variable names were based on the code, and may be even clean the code up by deoptimizing it too.

      Trying to make sense of decompiled code is pretty hard for any large code base.

      • Semperverus@lemmy.world
        link
        fedilink
        English
        arrow-up
        5
        ·
        edit-2
        5 months ago

        Deoptimization could definitely happen via AI or even just really good decompilers (much like the black magic that goes into compiler optimizations), but I think that the problem with coming up with original function names is that the information just isnt there. You or the AI can make assumptions and poor guesses, but from a data theory perspective, i think that the compilation process is highly lossy. As such, the AI would essentially have to pull things out of its metaphorical ass to make anything remotely functional. I’ve had AI write me code with functions that literally don’t exist in libraries before instead of telling me it’s not possible, and I’m sure many of you reading this have too. Extrapolating that kind of behavior onto this problem, I am doubtful of a successful implementation of this half of the idea.

        It sure as shit would be neat though if it could be done, and it would be a strong reciprocal to what Microsoft does with code theft to use as training data for copilot.