Re: Everything on the Stack

2012-02-22 Thread Janthinidae
of my program. Another problem with my whole, everything on the stack idea, is that D limits my arrays to an internal limit (any paramter to change it?). It's easy to create a stack overflow anyway, so why a limit? Walter says the limit is present because linkers have such limits

Re: Everything on the Stack

2012-02-22 Thread bearophile
everything on the stack. Yes both are Turing complete :) I meant to add with similar efficiency of C++ code too :-) Ok I understand it, but if some linkers fail, then isn't this the linkgers problem? I don't know, but I presume lot of people lump compiler and linker in their mind

Re: Everything on the Stack

2012-02-22 Thread bearophile
Try this too: __gshared int[1_000_000] array; void main() {} Sorry, I meant: __gshared int[1_000_000] array = void; void main() {} Bye, bearophile

Re: Everything on the Stack

2012-02-21 Thread Daniel Murphy
scope/scoped isn't broken, they're just not safe. It's better to have an unsafe library feature than an unsafe language feature.

Re: Everything on the Stack

2012-02-21 Thread Timon Gehr
On 02/21/2012 11:27 AM, Daniel Murphy wrote: scope/scoped isn't broken, they're just not safe. It's better to have an unsafe library feature than an unsafe language feature. scope is broken because it is not enforced by the means of flow-analysis. As a result, it is not safe. Copying it to

Re: Everything on the Stack

2012-02-21 Thread Don Clugston
On 21/02/12 12:12, Timon Gehr wrote: On 02/21/2012 11:27 AM, Daniel Murphy wrote: scope/scoped isn't broken, they're just not safe. It's better to have an unsafe library feature than an unsafe language feature. scope is broken because it is not enforced by the means of flow-analysis. As a

Re: Everything on the Stack

2012-02-21 Thread bearophile
Don Clugston: Does the library solution actually work the same as the language solution? Some time ago scoped worked worse than the built-in scope: http://d.puremagic.com/issues/show_bug.cgi?id=5115 But I don't know how well scoped works now, I have never used it any more. Bye, bearophile

Re: Everything on the Stack

2012-02-20 Thread Trass3r
scope auto e1 = new EntryInt(); Foo = e1.toFoo(); You don't need auto there. And scope is deprecated, use std.typecons' scoped

Re: Everything on the Stack

2012-02-20 Thread bearophile
, by just carefully create an own core class library (or just juse memcpy). Generally what's possible in C++ is possible in D too, even if maybe in a different way. I think all you say here is doable in D too, with different means. Another problem with my whole, everything on the stack idea

Everything on the Stack

2012-02-19 Thread Janthinidae
an own core class library (or just juse memcpy). struct Queue(T, int N) { } scope class MyClass { } Queue!(MyClass) m; Another problem with my whole, everything on the stack idea, is that D limits my arrays to an internal limit (any paramter to change it?). It's easy to create a stack overflow