Generic and fundamental language design issue

Walter Bright newshound2 at digitalmars.com
Sun Nov 4 15:52:44 PST 2012


On 11/4/2012 3:20 PM, Tommi wrote:
> It's great that optimizations could be used to eliminate unnecessary heap
> allocations. But it could be interesting to imagine a language where it was
> impossible for the programmer to explicitly specify the allocation method.
> Things would go to heap if it was determined necessary by compile-time analysis,
> and also when the heuristics determine there might a danger of stack overflow.
> Otherwise things would go to stack. Pointers (or rather re-directable
> references) would always be used for referring to existing variables (that could
> be on heap or not). Pointers would never represent "a variable allocated on heap".

That's what Java does today.


More information about the Digitalmars-d mailing list