For background, I am a programmer, but have largely ignored everything having to do with AI (re: LLMs) for the past few years.

I just got to wondering, though. Why are these LLMs generating high level programming language code instead skipping the middle man and spitting out raw 1s and 0s for x86 to execute?

Is it that they aren’t trained on this sort of thing? Is it for the human code reviewers to be able to make their own edits on top of the AI-generated code? Are there AIs doing this that I’m just not aware of?

I just feel like there might be some level of optimization that could be made by something that understands the code and the machine at this level.

  • AA5B@lemmy.world
    link
    fedilink
    arrow-up
    12
    arrow-down
    1
    ·
    1 month ago

    You’re assuming ai writes useable code. I haven’t seen it.

    Think of the ai more as a writing assistant, like autocomplete or stack overflow but more so. The IDE I use can autocomplete variables or function calls, but the ai can autocomplete entire lines of code or entire unit tests. AI might try to fit an online answer and related doc to solve a problem I’m seeing. AI might even create a class around a public api that is a great starting point for my code. AI can be a useful tool but it can’t write useable code

  • Grimy@lemmy.world
    link
    fedilink
    arrow-up
    7
    ·
    1 month ago

    You’re a programmer? Yes, integrating and debugging binary code would be absolutely ridiculous.

  • nandeEbisu@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    1 month ago
    1. Machine code is less portable, as new CPU optimizations and instructions are released, its easier to update a compiler to integrate those in its optimizations than regenerate and retest all of your code. Also, if you need to target different OSs, like windows vs MacOs vs Linux its easier to make portable code in something higher level like python or java.

    2. Static analysis to check for things like memory leaks or security vulnerabilities like sql injections are likely easier to do on human readable code rather than assembly.

    3. Its easier for a human to go in an tweak code that is written in human readable language rather than assembly.

  • dual_sport_dork 🐧🗡️@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 month ago

    I imagine this is hypothetically possible given correct and sufficient training data, but that’s besides the point I think needs to be made, here.

    Basically nothing anyone is programming in user space these days produces machine code, and certainly none of it runs on the bare metal of the processor. Nothing outside of extremely low power embedded microcontroller applications, or dweebs deliberately producing for oldschool video game consoles, or similar anyway.

    Everything happens through multiple layers of abstractions, libraries, hardware privilege levels, and APIs provided by your operating system. At the bottom of all of those is the machine code resulting in instructions happening on the processor. You can’t run plain machine code simultaneously with a modern OS, and even if you did it’d have to be in x86 protected mode so that you didn’t trample the memory and registers in use by the OS or other applications running on it, and you’d have a tough-to-impossible time using any hardware or peripherals including networking, sound, storage access, or probably even putting output on the screen.

    So what you’re asking for is probably not an output anyone would actually want.

  • Z3k3@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 month ago

    I think i saw a video a few weeks ago where 2 ai assistants realises the other was also an ai so they agreed to switch to another protocol (to me it sounded like 56k modem noises or old 8 bit cassette tapes played on a hifi) so they could communicate more efficiently.

    I suspect something similar would happen with code.

  • nek0d3r@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    2
    ·
    1 month ago

    Generative AI wasn’t made to write good code, nor can it. It was trained to make lazy junior developers pay for a subscription to give code reviewers even bigger headaches.