1. 8
  1.  

    1. 1

      I’m surprised this doesn’t already exist. I don’t have much experience with Swift, but I heard they’re going to use it instead of C++ for Ladybird. I’d have thought a language that doesn’t care to distinguish inline vs. heap-allocated arrays is pretty high level for a browser.

      1. 1

        It’s not that common to need a size-fixed-at-compile-time array. In C++ I don’t reach for std::array super often. For common cases like Cartesian coordinates Swift already has tuples.

        1. 1

          Semantically, no. From optimization perspective, quite a bit. Typical C code is full of buf[MAX_LEN], which is great for buffer overflows, but also great for avoiding temporary allocations.

          LLVM codebase uses SmallVector and SmallDenseMap everywhere.