• 𝕙𝕖𝕝𝕡
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 year ago

    To my knowledge, Ada doesn’t have an equivalent to Rust’s borrow checker. I also think I covered that base by specifying “mainstream” 😀

    • solrize
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      1 year ago

      There is a proposal for borrow checking in SPARK, borrowed (as it were) from Rust: https://arxiv.org/abs/1710.07047

      As a more general matter, borrow checking is only relevant if you’re using dynamic memory allocation and deallocation extensively. There are programs where that is needed and at the same time you don’t want GC, but I think of those as niche areas.

      In Ada you tend to not use dynamic allocation or pointers much. It supplies some alternatives that are perhaps not quite as flexible. For some more info, see this HN comment.

      The most safety critical programs of course usually don’t use dynamic allocation at all, since they can’t risk running out of memory.