• Thinker@lemmy.world
    link
    fedilink
    arrow-up
    19
    ·
    18 hours 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
      arrow-up
      1
      ·
      edit-2
      15 hours 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.