• JackbyDev@programming.dev
    link
    fedilink
    English
    arrow-up
    1
    ·
    19 days ago

    Is there any reason an OO language couldn’t have a borrow checker? Sure, it would be wildly more complex to implement but I don’t see how it’s impossible.

    • magic_lobster_party@fedia.io
      link
      fedilink
      arrow-up
      2
      ·
      18 days ago

      OO languages typically use garbage collector. The main purpose of the borrow checker is to resolve the ambiguity of who is responsible for deallocating the data.

      In GC languages, there’s usually no such ambiguity. The GC takes care of it.