• pro3757@programming.dev
    link
    fedilink
    arrow-up
    109
    ·
    6 days ago

    It’s in Intercal, a joke language from '70s. Mark Rendle describes it here in his talk at NDC. This whole talk is ridiculous btw.

    • frezik@midwest.social
      link
      fedilink
      arrow-up
      161
      ·
      6 days ago

      This is the same language where you have to say PLEASE sometimes or it won’t compile. But if you say PLEASE too much, the compiler will think you’re pandering and also refuse to compile. The range between too polite and not polite enough is not specified and varies by implementation.

  • mossy_@lemmy.world
    link
    fedilink
    arrow-up
    32
    ·
    6 days ago

    Guy who worked at my place before me kept using these and GOTO statements all over the place.

    His name? Cotton-eyed Joe

  • rand_alpha19@moist.catsweat.com
    link
    fedilink
    arrow-up
    39
    ·
    6 days ago

    That sounds like a fucking nightmare. I had to troubleshoot poorly-written-yet-somehow-functional GOTOs a lot when I was a BAS technician and that’s annoying enough.

    • Doesn’t it steal control flow? More like a break point, except you define where execution continues.

      I wonder if it’s a compile error to have multiple conflicting COMEFROM statements, or if it’s random, kind of like Go’s select statement.

      How awesome would it be to be able to steal the execution stack from arbitrary code; how much more awesome if it was indeterminate which of multiple conflicting COMEFROM frames received control! And if it included a state closure from the stolen frame?

      Now I want this.

      • davidgro@lemmy.world
        link
        fedilink
        arrow-up
        9
        ·
        6 days ago

        I wonder if it’s a compile error to have multiple conflicting COMEFROM statements

        I think there’s at least one INTERCAL implementation where that’s how you start multi-threading

    • magic_lobster_party@kbin.run
      link
      fedilink
      arrow-up
      12
      ·
      6 days ago
      print(A)
      print(B)
      hello: print(C)
      print(D)
      print(E)
      comefrom hello
      print(F)
      

      This will print A, B, C and then F. D and E will be skipped because of the comefrom.

    • Cethin@lemmy.zip
      link
      fedilink
      English
      arrow-up
      5
      ·
      6 days ago

      A function will be called by code and go to that point in code. To implement functions, you store necessary things to memory and goto the function definition. To implement that with comefrom you’d have to have a list of all the places that need to call the function as comefroms before the function definition. It’d be a mess to read. We almost never care where we are coming from. We care where we’re going to. We want to say “call function foo” not “foo takes control at line x.”

    • sudo@programming.dev
      link
      fedilink
      arrow-up
      4
      ·
      6 days ago

      Its like if subroutine bar could say its going to execute at line N of routine foo. But if you were just reading foo then you’d have no clue that it would happen.

      You can simulate this effect with bad inheritance patterns.

    • palordrolap@kbin.run
      link
      fedilink
      arrow-up
      6
      ·
      6 days ago

      I’d say it’s more like setting up a handler for a callback, signal, interrupt or something along those lines.

      Function declarations by themselves don’t usually do that. Something else has to tell the system to run that function whenever the correct state occurs.

      That doesn’t account for unconditional come-froms.¸but I expect there’d have to be a label at the end of some code somewhere that would give a hint about shenanigans yet to occur. Frankly that’d be worse than a goto, but then, we knew that already.