C++ Logo

liaison

Advanced search

Re: [wg14/wg21 liaison] Multidimensional subscript operator

From: Jₑₙₛ Gustedt <jens.gustedt_at_[hidden]>
Date: Fri, 30 Apr 2021 10:46:37 +0200
Ville,

on Fri, 30 Apr 2021 11:23:59 +0300 you (Ville Voutilainen
<ville.voutilainen_at_[hidden]>) wrote:

> On Fri, 30 Apr 2021 at 11:08, Jₑₙₛ Gustedt <jens.gustedt_at_[hidden]>
> wrote:
> > > Right, attempts to introduce VLAs into C++ have failed.
> >
> > I don't know what is right about this. They "have not failed" in a
> > passive way, but people have actively decided to make them fail.
>
> I don't know what you mean by that. We had multiple different
> approaches a couple of years ago tried, but they failed to gain
> consensus.
>
> > I think, Martin was trying to tell you that VM types have merits and
> > are particularly easy to use in function interfaces, are very
> > efficient and allow for bounds checking. The way that VLAs are
> > referred to in C++ documents (for example the document that
> > originated this thread) shows that they are not completely
> > understood in the C++ community.
>
> I don't know what you mean by that either; can you point to a specific
> part of P2128
> that you're talking about here?

I take that back in the sense that Martin's message from last Sunday
referred to a seemingly misunderstanding about multi-dimensional
arrays in C as a whole, not only VLA in particular. The implicit
understanding there seems to be that dynamic arrays in C have to be
emulated as arrays of pointers.

> I would hesitate to suggest that lack of understanding is what
> causes the failure of adopting VLAs into C++.

My personal experience when talking to people from the C++ community
is that often there is a lack of such understanding. For example, to
know that VLA and VM types are different things, that VM types as
function interfaces don't have the disadvantages that have automatic
VLA if defined on the stack, and that VM types can easily be
dynamically allocated with no fuzz.

Discussion about VM types (or VLA because people don't know the
difference) quickly become hostile. It seems that historically the
subject is quite overloaded. I would be cool if we could overcome that
social difficulty.

Thanks
Jₑₙₛ

-- 
:: INRIA Nancy Grand Est ::: Camus ::::::: ICube/ICPS :::
:: ::::::::::::::: office Strasbourg : +33 368854536   ::
:: :::::::::::::::::::::: gsm France : +33 651400183   ::
:: ::::::::::::::: gsm international : +49 15737185122 ::
:: http://icube-icps.unistra.fr/index.php/Jens_Gustedt ::

Received on 2021-04-30 03:47:24