It works fine in C though, or FORTRAN, or Ada, or ALGOL 60, ...
NVidia has pivoted to design CUDA hardware with focus on C++ back in , and seems to be doing quite well for them.
CppCon 2017: "Designing (New) C++ Hardware”
https://www.youtube.com/watch?v=86seb-iZCnI
They were also the ones sponsoring the ISO work on mdspan, while HPC research labs are pushing for linalg on top.
I would rather be using Ada today, but that isn't how the world moves.
I respect Ada but I would not want to use it. But I have a choice between C++ with hmdspan and C99's arrays, I choose C99 any time.
You can even use unconstrained arrays to provide the same functionality that Optional does in functional-programming, provided the element-type can be an element of an array:
-- Here we define an index-type with one value.
Subtype Boolean_Index is Boolean range True..True;
-- And here we define an array indexed by it, but can also have length 0.
Type Optional(Boolean_Index range <>) of Element;
And there you have the mechanism for Optional; just use "For Object of Optional_Array Loop" to enclose your operations and bam, it works perfectly.The std:mdspan proposal came from NVidia employees, alongside AMD and HPC research labs.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p00...
Yeah, I remember discussions on comp.lang.c calling programming with Ada, or even Modula-2, programming with straightjacket.
Meanwhile governments and national security bodies got another point of view.
You mean the C99 arrays Google paid the work to clean from the Linux kernel?
The kernel removed VLAs, I am more talking about vm types. But even for VLA - while I had a small role in that undertaking myself - I think it was a stupid mistake from a security point of view to remove VLAs from the kernel. Google pays for a lot of nonsense...