January 12, 2022
On Wed, Jan 12, 2022 at 11:14:54AM -0500, Steven Schveighoffer via Digitalmars-d-announce wrote: [...]
> Look at Sociomantic -- they still used the GC, just made sure to minimize the possibility of collections.
> 
> I wonder if there is just so much fear of the GC vs people who actually tried to use the GC and it failed to suit their needs. I've never been afraid of the GC in my projects, and it hasn't hurt me at all.
[...]

Like I said, my suspicion is that it's more of a knee-jerk reaction to the word "GC" than anything actually founded in reality, like somebody actually wrote a game in D and discovered the GC is a problem vs somebody is *thinking* about writing a game in D, then thinks about the GC, then balks because of the expectation that the GC is going to do something bad like kill the hypothetical framerate or make the not-yet-implemented animation jerky.

Those who actually wrote code and found GC performance problems would have just slapped @nogc on their code or inserted GC.disable at the beginning of the game loop and called it a day, instead of getting all knotted up in the forums about why GC is bad in principle.


T

-- 
I'm still trying to find a pun for "punishment"...
January 12, 2022
On Wednesday, 12 January 2022 at 16:17:02 UTC, H. S. Teoh wrote:
> Depends on what kind of games, I guess. If you're writing a 60fps real-time raytraced 3D FPS running at 2048x1152 resolution, then *perhaps* you might not want a GC killing your framerate every so often.

Resolution is down to GPU performance, raytracing ditto.  Realtime GC is a thing (not for d, of course); consistently sub-millisecond pause times are achievable.  Given 16ms frametimes (you mention 60fps), that seems reasonable.


> (But even then, there's always GC.disable and @nogc... so it's not as if you *can't* do it in D. It's more a psychological barrier triggered by the word "GC" than anything else, IMNSHO.)

Agree.

January 12, 2022

On Wednesday, 12 January 2022 at 16:14:54 UTC, Steven Schveighoffer wrote:

>

On 1/12/22 10:41 AM, Adam D Ruppe wrote:

>

On Wednesday, 12 January 2022 at 15:25:37 UTC, H. S. Teoh wrote:

>

    However it turns out that unless you are writing a computer
    game, a high frequency trading system, a web server

Most computer games and web servers use GC too.

idk about hf trading.

I know for sure that one was written in JAVA, using Azul C4 and other tech to maximize performance...

>

Yeah, I had trouble agreeing with that statement too.

Just wait for Paulo Pinto to join the conversation, he will happily refer a lot of tech and products using GC which are high performant and very successful ;-)

>

I wonder if there is just so much fear of the GC vs people who actually tried to use the GC and it failed to suit their needs. I've never been afraid of the GC in my projects, and it hasn't hurt me at all.

I think it stems from experience from long ago when JAVA was HOT and sold as the solution of all world problems, but failed to meet expectations and was dismissed because they found is was the GC what made it fail..

A lot of engineers just repeat the opinion of some guru they admire without fact checking.

Although I've seen various serious performance issues with JAVA and python software, only once it was related to the GC..

January 12, 2022

On Wednesday, 12 January 2022 at 16:52:02 UTC, Arjan wrote:

> >

I wonder if there is just so much fear of the GC vs people who actually tried to use the GC and it failed to suit their needs. I've never been afraid of the GC in my projects, and it hasn't hurt me at all.

I think it stems from experience from long ago when JAVA was HOT and sold as the solution of all world problems, but failed to meet expectations and was dismissed because they found is was the GC what made it fail..

A lot of engineers just repeat the opinion of some guru they admire without fact checking.

Although I've seen various serious performance issues with JAVA and python software, only once it was related to the GC..

I don't think they're necessarily wrong. If you don't want to deal with GC pauses, it may well be easier to use an approach that doesn't have them, in spite of what you have to give up. On the other hand, many of them have no idea what they're talking about. Like claims that a GC gets in your way if the language has one.

January 12, 2022
On Wed, Jan 12, 2022 at 05:42:46PM +0000, bachmeier via Digitalmars-d-announce wrote:
> On Wednesday, 12 January 2022 at 16:52:02 UTC, Arjan wrote:
[...]
> > I think it stems from experience from long ago when JAVA was HOT and sold as the solution of all world problems, but failed to meet expectations and was dismissed because they found is was the GC what made it fail..

That was my perception of GC too, colored by the bad experiences of Java from the 90's.  Ironically, Java's GC has since improved to be one of the top world-class GC implementations, yet the opinions of those who turned away from Java in the 90's have not caught up with today's reality.


[...]
> I don't think they're necessarily wrong. If you don't want to deal with GC pauses, it may well be easier to use an approach that doesn't have them, in spite of what you have to give up. On the other hand, many of them have no idea what they're talking about. Like claims that a GC gets in your way if the language has one.

Depends on the language; some may indeed require GC use to write anything meaningful at all, and some may have the GC running in the background.  However, D's GC only ever triggers on allocations, and as of a few releases ago, it doesn't even initialize itself until the first allocation, meaning that it doesn't even use up *any* resources if you don't actually use it (except for increasing executable size, if you want to nitpick on that).  This must be one of the most non-intrusive GC implementations I've ever seen.  Which makes me *really* incredulous when the naysayers complain about it.


T

-- 
There are two ways to write error-free programs; only the third one works.
January 12, 2022
On 1/12/2022 8:14 AM, Steven Schveighoffer wrote:
> I wonder if there is just so much fear of the GC vs people who actually tried to use the GC and it failed to suit their needs. I've never been afraid of the GC in my projects, and it hasn't hurt me at all.

My experience with people who don't want to use a product I've worked on is:

1. they'll give reason X, which is usually something that sounds convenient
2. I fix X, they can use it now!
3. they then give reason Y, after thinking about it for a minute

What's happening is neither X nor Y is the real reason. They just don't want to tell me the real reason, usually because it's an emotional one.


The GC issue fits all of that.

For example, back in the olden days (the 1980s), as related to me by a friend:

X: The most important thing I want in a C++ compiler is speed! I cannot emphasize enough how important that is!
Y: No, that isn't the reason. The most important thing to you in a C++ compiler is brand name.
X: (Dumbfounded) Why would you say that?
Y: Because you are using Microsoft C++, which is 4 times slower than Zortech C++.
X: Oh.


Another one:

Friend: You should write a native Java compiler! It'll take over the world! I really want a native Java compiler!
Me: I already wrote one, Symantec's Java compiler. You can get it and use it today!
Friend: Oh. [Changes the subject]


Now, consider BetterC, a 90% subset of D, and no GC in sight. It changed nobody's mind who didn't use D "because of the GC", because that is not the real reason.

January 12, 2022
On Wednesday, 12 January 2022 at 16:14:54 UTC, Steven Schveighoffer wrote:
>
>
> I wonder if there is just so much fear of the GC vs people who actually tried to use the GC and it failed to suit their needs. I've never been afraid of the GC in my projects, and it hasn't hurt me at all.
>
> -Steve

No. Fear is irrelevant.

Fear of GC is just a catch-all-phrase that serves no real purpose, and provides no real insight into what programmers are thinking.

It's all about autonomy and self-government (on the decision of whether to use GC or not, or when to use it, and when not to use it.

Programmers want the right of self-government, over their code.

This is not politics. It's human psychology.

It is, to a large extent I believe, what attracts people to D.

I don't believe people are attracted to D because it has GC. There are better languages, and better supported languages, with GC.

D should not spend time promoting 'GC', but rather promote how programmers can have this autonomy.

Also, the idea that 'GC' means you never have to think about memory management... is just a ridiculous statement..

..Every programmer *should* be thinking about memory management.

January 12, 2022

On Wednesday, 12 January 2022 at 20:48:39 UTC, forkit wrote:

>

Fear of GC is just a catch-all-phrase that serves no real purpose, and provides no real insight into what programmers are thinking.

"Fear of GC" is just a recurring excuse for not fixing the most outdated aspects of the language/compiler/runtime.

I have no fear of GC, I've used GC languages since forever, but I would never want a GC in the context of system level or real time programming. I also don't want to deal with mixing mostly incompatible memory management schemes in an application dominated by system level programming.

In this context a GC should be something local, e.g. you might want to use a GC for a specific graph or scripting language in your application.

Do I want a GC/ARC for most of my high level programming? Hell yes! But not for system level programming, ever.

(Walter has always positioned D as a system level language and it should be judged as such. Maybe D isn't a system level language, but then the vision should be changed accordingly.)

>

It's all about autonomy and self-government (on the decision of whether to use GC or not, or when to use it, and when not to use it.

Which essentially is the essence of system level programming. You adapt the language usage to the hardware/use context, not the other way around.

You shouldn't be glued to nonsensical defaults that you have to disable. You should have access to building blocks that you can compose to suit the domain you are working with.

A GC can be one such building block, and in fact, the C++ community does provide several GCs as building blocks, but there is no force feeding… Which is why C++ is viewed as a hard core system level language by everyone and D isn't.

>

I don't believe people are attracted to D because it has GC. There are better languages, and better supported languages, with GC.

Or more importantly; low latency GCs and a language designed for it!

>

Also, the idea that 'GC' means you never have to think about memory management... is just a ridiculous statement..

I don't have to think much about memory management in Python, JavaScript or Go, but I would also never do anything close to system level programming in those languages.

You can create very interesting interactive applications in JavaScript, but then you:

  1. Rely on clever system level programming in a very heavy browser runtime.

  2. Use an eco system for interactive applications that is designed around the specific performance characteristics of the javascript runtime.

  3. Adapt the application design to the limitations of the browser platform.

  4. Get to use a much better low latency GC.

Point 1, 2 and 3 are not acceptable for a system level language… So that is a different situation. And D does not provide 4, so again, a different situation.

Cheers!

January 12, 2022
On Wednesday, 12 January 2022 at 20:41:56 UTC, Walter Bright wrote:
>
> My experience with people who don't want to use a product I've worked on is:
>
> 1. they'll give reason X, which is usually something that sounds convenient
> 2. I fix X, they can use it now!
> 3. they then give reason Y, after thinking about it for a minute
>
> What's happening is neither X nor Y is the real reason. They just don't want to tell me the real reason, usually because it's an emotional one.

Yes, emotions come into play, but the 'emotion argument' on its own explains nothing.

The 'real reason' is that people are by nature, aversive to losses.

This impacts how people evaluate a choice.

e.g. an aversion to losing an existing skill set...

what you need to do, is argue you're case in a way that produces more dopamine neurons to activate ;-)

https://en.wikipedia.org/wiki/Loss_aversion

January 13, 2022

On Wednesday, 12 January 2022 at 02:37:47 UTC, Walter Bright wrote:

>

"Why I like D" is on the front page of HackerNews at the moment at number 11.

https://news.ycombinator.com/news

Chinese version,and another one.