back

by uecker·3y ago·view on hn ↗
VLA are exactly an array type that knows its length, i.e. a dependent type. VLAs on the stack had some issues, but pointers to VLAs, i.e. variably modified types are quite powerful. Language and compiler support is still evolving though.

But you can get run-time bounds checking already: https://godbolt.org/z/jhcavobYj

Support for statically detecting problems is also (slowely) improving.