Does 'D' language supports 'C' like VLA?

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Mon Apr 13 11:55:06 PDT 2015


Steven Schveighoffer:

> It's very unlikely this will make it into the language. Alloca 
> should be good enough for this, it's not a very common usage, 
> and supporting it is not easy.

alloca is bug-prone and unsafe, and if you want to create a 2D 
array on the stack it's not good enough.
They are uncommonly used because they are not supported by the D 
compiler, and it doesn't track the memory ownership well enough.
But a well designed system language needs to push programmers to 
use the stack as much as possible.

Bye,
bearophile


More information about the Digitalmars-d mailing list