Re: Garbage collection, and practical strategies to avoid allocation

2013-06-03 Thread Steven Schveighoffer
On Sat, 01 Jun 2013 07:10:07 -0400, Michel Fortin wrote: On 2013-06-01 02:02:53 +, Manu said: * find a solution for deterministic embedded garbage collection I think reference counting while still continuing to use the current GC to release cycles is the way to go. It wouldn't be

Re: Garbage collection, and practical strategies to avoid allocation

2013-06-01 Thread Vladimir Panteleev
On Saturday, 1 June 2013 at 13:25:20 UTC, Joseph Rushton Wakeling wrote: Someone on a Reddit thread pointed to the Nimrod GC design -- looks potentially interesting from your perspective: http://nimrod-code.org/gc.html From the page: but it may scan the delta-subgraph of the heap that changed

Re: Garbage collection, and practical strategies to avoid allocation

2013-06-01 Thread Jonathan M Davis
On Saturday, June 01, 2013 09:43:49 bearophile wrote: > > - GC runs at unpredictable moments > > Is this true? I think the D GC runs only when you allocate > something. Sure, but which of these calls to new is going to cause the GC to run? auto a = new Foo; ... auto b = new Bar; ... auto c = ne

Re: Garbage collection, and practical strategies to avoid allocation

2013-06-01 Thread Michel Fortin
On 2013-06-01 02:02:53 +, Manu said: * find a solution for deterministic embedded garbage collection I think reference counting while still continuing to use the current GC to release cycles is the way to go. It wouldn't be too hard to implement. This could make it realistic to disa

Re: Garbage collection, and practical strategies to avoid allocation

2013-06-01 Thread Benjamin Thaut
In my eyes there is just one reason there is no better GC yet: It requires compiler support. And thats a huge problem. The number of people who would actually be ablte to make the modifications on the compiler in this community is very small and they tend to not have much time doing it. A real

Re: Garbage collection, and practical strategies to avoid allocation

2013-06-01 Thread Jacob Carlborg
On 2013-06-01 04:16, Adam D. Ruppe wrote: Some little things we could do is add overloads to some functions that return string to be able to take a buffer argument too. string to(T:string)(int a) { char[] buf = new char[](16); return assumeUnique(to(a, buffer)); char[] to(int a, char[] buffer)

Re: Garbage collection, and practical strategies to avoid allocation

2013-06-01 Thread js.mdnq
Nothing will get done until someone decides to put in the effort to fix the problem. D's biggest drawback at this point is the GC and one would think with all the smart people around here someone would have solved this problem by now. We need a solution that allows one to "plug and play" diffe

Re: Garbage collection, and practical strategies to avoid allocation

2013-06-01 Thread Joseph Rushton Wakeling
On 06/01/2013 04:02 AM, Manu wrote: > While I do think a sufficiently advanced GC might satisfy the realtime > environment, the more I think about it, the more I am thinking a GC is not > applicable to the embedded (or memory limited) environment. > > So what options exist? > > I'm thinking more

Re: Garbage collection, and practical strategies to avoid allocation

2013-06-01 Thread bearophile
Manu: - Scanning the whole heap is costly Rust avoids this giving a different heap to each thread, and common heap to share data managed with unique references. - GC runs at unpredictable moments Is this true? I think the D GC runs only when you allocate something. Bye, bearophile

Re: Garbage collection, and practical strategies to avoid allocation

2013-05-31 Thread SomeDude
On Saturday, 1 June 2013 at 02:03:07 UTC, Manu wrote: So let's talk about garbage collection, and practical strategies to avoid allocation. Discuss... (or perhaps, "destroooy") Here is my take: http://forum.dlang.org/post/tftjtzmfuauxwcgco...@forum.dlang.org Sorry, I didn

Re: Garbage collection, and practical strategies to avoid allocation

2013-05-31 Thread Brad Anderson
On Saturday, 1 June 2013 at 04:16:44 UTC, Jonathan M Davis wrote: [snip] The situation is even worse with narrow strings (assuming that put works with them - I'm not sure that it does at the moment) given that even if you knew their length (which you wouldn't if you were going by hasLength), yo

Re: Garbage collection, and practical strategies to avoid allocation

2013-05-31 Thread Jonathan M Davis
On Saturday, June 01, 2013 04:47:39 Brad Anderson wrote: > I played around with adding an overload that accepted an output > range to some of the std.string functions identified in my run of > -vgc over phobos[1] (after Jonathan pointed out this is probably > the best approach and is already what f

Re: Garbage collection, and practical strategies to avoid allocation

2013-05-31 Thread Brad Anderson
On Saturday, 1 June 2013 at 02:47:40 UTC, Brad Anderson wrote: static arrays would need some sort of wrapper to make them output ranges I believe unless it was decided that put() should work by replacing the front and calling popFront for them (which I kind of doubt is the desired behavior).

Re: Garbage collection, and practical strategies to avoid allocation

2013-05-31 Thread Brad Anderson
On Saturday, 1 June 2013 at 02:16:02 UTC, Adam D. Ruppe wrote: just to toss in my quick thoughts, I wrote a couple comments on the recent reddit thread about using D with a minimal runtime and some of the talk may be relevant here too: http://www.reddit.com/r/programming/comments/1fc9jt/dmd_20

Re: Garbage collection, and practical strategies to avoid allocation

2013-05-31 Thread Adam D. Ruppe
just to toss in my quick thoughts, I wrote a couple comments on the recent reddit thread about using D with a minimal runtime and some of the talk may be relevant here too: http://www.reddit.com/r/programming/comments/1fc9jt/dmd_2063_the_d_programming_language_reference/ca94mek Some little th

Garbage collection, and practical strategies to avoid allocation

2013-05-31 Thread Manu
So let's talk about garbage collection, and practical strategies to avoid allocation. GC related discussions come up basically every day, perhaps multiple times a day on IRC, and the recent reddit 2.063 release thread is dominated by C++ programmers who are keenly interested in D, but are s