• Thinker
    link
    fedilink
    202 days ago

    Congratulations, you’ve illustrated the difference between syntax and semantics. But any competent compiler also handles semantics (just in a separate phase of compilation), because that’s necessary for any useful conversion to machine code, not to mention optimizations.

    • @CanadaPlus@lemmy.sdf.org
      link
      fedilink
      1
      edit-2
      2 days ago

      It’s more like they handle a smaller, toy version of semantics that you can actually code a compiler for. In OP, something semantically correct in that version but not by common sense was accidentally written.

      Maybe an early LLM that talks about picking up fire would be a better analogy.