News for hackers. Stuff that matters.
Re:Ada for the C++ and Java Developer [pdf] by fpoling on Sunday March 28, 2021 @07:29AM (#26609447)
In addition Ada allows dynamically-sized arrays to be allocated on the stack and to be returned from a function. Efficient implement of the latter requires rather non-trivial support on the compiler side and C/C++/Rust have nothing like that. Yet in many cases it allows to eliminate new/delete and simplify code.

For example, just consider if C allowed to return a plain C string from a function without any heap allocation. Things like unsafe sprintf/strcopy would never happen then.

Re:Ada for the C++ and Java Developer [pdf] by okl on Sunday March 28, 2021 @11:14AM (#26611028)
There a two stacks, the call stack, and a stack for returned values of dynamic size, not very complicated, is it?
Re:Ada for the C++ and Java Developer [pdf] by pjmlp on Sunday March 28, 2021 @09:24AM (#26610152)
Yes that is what I mean by allocation being handled by the compiler.