June 04, 2021
04.06.2021 16:32, Ola Fosheim Grøstad пишет:
> On Friday, 4 June 2021 at 12:44:07 UTC, Imperatorn wrote:
>> GC won't go away tho. What might happen is more flexibility. The GC-phobia is irrational.
> 
> The topic doesn't fit in this thread, but it isn't irrational.
> 
> You have to wait for all participating threads to be ready to collect, so it isn't only about collection speed. In essence you end up with some of the same issues as with cooperative multitasking.
> 
> And it is also obvious that collection speed will drop as your application grows and you start working with larger datasets.
> 
> So, you might initially think it is fine, but end up rewriting your codebase because it only worked well with the simple prototype you started with.
> 
> That's not a good strategy.
> 
> (but ok for batch programs)
> 

I use GC when developing an algorithm to solve my problem. After I has implemented the algorithm I can redesign it to avoid GC (if needed). It works pretty nice in my case at least. Because initially I concentrate on my domain problem and then I only deal with memory management. This separation is very helpful.
Also there is no rewriting when you switch to manual management - you just add new code, no replacing old code. Again often API  is worse after switching than in case of GC.
June 04, 2021
On Friday, 4 June 2021 at 14:07:38 UTC, drug wrote:
> I use GC when developing an algorithm to solve my problem. After I has implemented the algorithm I can redesign it to avoid GC (if needed). It works pretty nice in my case at least. Because initially I concentrate on my domain problem and then I only deal with memory management. This separation is very helpful.

Yes, if you select that strategy from the start.

But think for a moment how much easier it would be if the language had ownership pointers. I also believe that careful usage of ownership pointers in combination with precise scanning could lead to much less memory being scanned.

There are no language features in D that support GC-strategies. That's not a strength.

They can be remedied, but it takes willpower.

June 04, 2021
On Thursday, 3 June 2021 at 23:48:16 UTC, zjh wrote:

> D does not owns the advantages of GC , but all the disadvantages of GC .Why not discard it?

This is not a realistic or helpful suggestion. You're proposing to get rid of current users of the language - many of whom like that there's a GC - in order to chase C++ programmers, who represent a small sliver of all programmers, who mostly wouldn't change languages anyway, and who would change to Rust if they were planning to change languages. Again, not a helpful suggestion.
June 04, 2021

On Wednesday, 2 June 2021 at 14:02:29 UTC, Mike Parker wrote:

>

On Wednesday, 2 June 2021 at 11:10:36 UTC, Dukc wrote:

>

Phobos v2 is an official plan? That was news for me! Any chance to get a glimpse of what's planned for it?

The overall goal is that it doesn't replace the current Phobos, but sits alongside it. Changed/improved/new functionality goes in the std.v2 namespace (or whatever it looks like in the end) and you can import that alongside existing std packages.

I thought v2 is what it currently is, so the next would be v3.

June 04, 2021

On Friday, 4 June 2021 at 13:32:37 UTC, Ola Fosheim Grøstad wrote:

>

On Friday, 4 June 2021 at 12:44:07 UTC, Imperatorn wrote:

>

GC won't go away tho. What might happen is more flexibility. The GC-phobia is irrational.

The topic doesn't fit in this thread, but it isn't irrational.

You have to wait for all participating threads to be ready to collect, so it isn't only about collection speed. In essence you end up with some of the same issues as with cooperative multitasking.

And it is also obvious that collection speed will drop as your application grows and you start working with larger datasets.

So, you might initially think it is fine, but end up rewriting your codebase because it only worked well with the simple prototype you started with.

That's not a good strategy.

(but ok for batch programs)

You might be surprised, but it's actually not up to you what topic fits or not.

I said GC-phobia is irrational, I did not say any criticism of it is.
Obviously GC is good for some things and not good at all for other things.

What is irrational is saying it has absolutely no place at all.

June 04, 2021

On Friday, 4 June 2021 at 18:34:32 UTC, Imperatorn wrote:

>

You might be surprised, but it's actually not up to you what topic fits or not.

I said GC-phobia is irrational, I did not say any criticism of it is.
Obviously GC is good for some things and not good at all for other things.

What is irrational is saying it has absolutely no place at all.

I don't think it is a phobia but it is a question of choice. We can clearly observe how different the demands are for different programmers in this forum. I enjoy GC for the appropriate programs, however there are SW where GC is a problem and cannot be used. Because of this Phobos must take the lowest common denominator approach (malloc/free) in order to be able to accommodate all the different needs.

D is one these Swiss army knife languages that can be used for everything, including low level software and everything in between. What D should strive for is to give programmers a choice and put up as few barriers as possible. It's certainly challenging to make a library and language fitting everyone needs but D is at least one of the best foundation of achieving that goal.

June 04, 2021

On Friday, 4 June 2021 at 19:31:57 UTC, IGotD- wrote:

>

Because of this Phobos must take the lowest common denominator approach (malloc/free) in order to be able to accommodate all the different needs.

This uniformization sounds too good to be true. I think most people think that, but it's simply not true. malloc/free is incompatible to garbage collection.
You can parametrize over all possible MM strategies making every function generic and pass the right MM into it.
Beside increasing template bloat it isn't that optimal as the same code has different performance characteristic for each MM, so you need to overload over all these and even then you won't cover all the MM because there are people wanting to insert their custom MM, but the library was already written.

I'm asking myself, even if we don't care about the cons, would that at all be possible with a ~20 years old language with a ~20 years of ecosystem evolution. How many things need to be rewritten?

June 04, 2021

On Friday, 4 June 2021 at 19:56:06 UTC, sighoya wrote:

>

This uniformization sounds too good to be true. I think most people think that, but it's simply not true. malloc/free is incompatible to garbage collection.

This is true and even druntime has a malloc/free option for the GC. However, its implementation is really bad. Also the implementation of the current GC has a lot of room for improvements. It is still not appropriate for many embedded systems as it requires another layer that steals CPU time and code memory.

In the case of Phobos, in order to make as versatile as possible it shall not assume any other layer than malloc/free.

>

I'm asking myself, even if we don't care about the cons, would that at all be possible with a ~20 years old language with a ~20 years of ecosystem evolution. How many things need to be rewritten?

D certainly has the power to do so but the question is if there is any will power in this community. Nothing has happened for almost 20 years.

June 04, 2021

On Friday, 4 June 2021 at 21:35:43 UTC, IGotD- wrote:

>

D certainly has the power to do so but the question is if there is any will power in this community. Nothing has happened for almost 20 years.

I guess importC will make changes even more unlikely. Absorbing C is nice, but it has the unfortunate effect of giving D some of the same disadvantages as C++.

June 05, 2021

On Friday, 4 June 2021 at 18:34:32 UTC, Imperatorn wrote:

>

You might be surprised, but it's actually not up to you what topic fits or not.

This is the announce forum, so it is kinda misplaced, but we are all contributing to this so... :)

>

Obviously GC is good for some things and not good at all for other things.

The problem is that the D-style GC is not a good fit for anything interactive, beyond simple applications.

My impression is that most people use D for batch programs, so I guess that shapes the opinion. And that is a problem for D. A bad GC-strategy is reinforced by the remaining majority, which is a tiny fraction of the overall programming community.

These days you don't really need a system level language to write batch programs. So it is not a good strategy to hold onto this specific type of stop-everything-scan-everything GC. Unless D decides to not be a system level language, but then you need a lot more convenience features and become more scripty. The inbetween position is not the top-pick for anyone looking for a solution.

Not being willing to switch MM strategy means being stuck on a tiny island, too afraid of crossing the ocean to get access to the main land. My impression is that Walter would rather stay on this tiny island than take any chances.

The language is being extended with incomplete experimental features, instead of going to the core of the issue and doing something with the foundation for the language. That is not going to end well. You'll end up with a patchwork.