Thread overview | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
July 09, 2020 GC/nogc status in docs | ||||
---|---|---|---|---|
| ||||
Has there been any consideration on tagging Phobos function as either GC or no-GC depending on how they behave for general awareness when reading the docs? I'm thinking it could be useful to know what you get. |
July 13, 2020 Re: GC/nogc status in docs | ||||
---|---|---|---|---|
| ||||
Posted in reply to aberba | On Thursday, 9 July 2020 at 12:55:45 UTC, aberba wrote: > Has there been any consideration on tagging Phobos function as either GC or no-GC depending on how they behave for general awareness when reading the docs? > > I'm thinking it could be useful to know what you get. So I need to expand on this. For example if you read this post's cmments: https://dlang.org/blog/2019/10/15/my-vision-of-ds-future/ There's lots of comments about D's GC which most core members of the community know its isn't true at all CURRENTLY. The rumors eventually becomes facts. And there's a lot of cleaning up of D's reputation to do. Its everywhere I read about D. Lots of misinformation out there about the current status of Phobos in terms of how much of it is GC/nogc and the myth around the need for GC in the first place. Atila answered very well quite a lot of the questions but that's for just SOMEONE who read the post's comments. GC, RAII, RC, so many misinformation HN, reddit, etc. (been doing some research BTW) The > From what I have read,... is all over the place. See https://dlang.org/blog/2019/10/15/my-vision-of-ds-future/#comment-14607 Marking functions in docs as GC or nogc goes beyond just function signatures cus what you find in the D docs is meaningless IMO to many new comers. OR a least anyway else to improve and make things clear. BTW, its not just GC. IDEs, debugging, etc it all add up. Can we a least remove all the dead IDEs/editors and GUIs from the Wiki and only leave out the good/reliable options? |
July 13, 2020 Re: GC/nogc status in docs | ||||
---|---|---|---|---|
| ||||
Posted in reply to aberba | On Monday, 13 July 2020 at 11:16:07 UTC, aberba wrote:
> The
>> From what I have read,...
> is all over the place.
Perhaps we need a sort of "mythbusting" page.
"
MYTH: D's GC will **randomly** cause pauses in your program!
FACT: D's GC only decides if it needs to run during allocations, and collections can be manually disabled for hot paths(GC.disable/GC.enable), as well as forced prematurely (GC.collect).
"
And the like.
|
July 13, 2020 Re: GC/nogc status in docs | ||||
---|---|---|---|---|
| ||||
Posted in reply to aberba | On Thursday, 9 July 2020 at 12:55:45 UTC, aberba wrote:
> Has there been any consideration on tagging Phobos function as either GC or no-GC depending on how they behave for general awareness when reading the docs?
>
> I'm thinking it could be useful to know what you get.
I wonder how much of Phobos is not @nogc simply because of the use of exceptions. Walter had some ideas that would allow exceptions to work without GC. Is there any progress?
|
July 13, 2020 Re: GC/nogc status in docs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ogi | On Monday, 13 July 2020 at 18:14:56 UTC, Ogi wrote:
> On Thursday, 9 July 2020 at 12:55:45 UTC, aberba wrote:
>> Has there been any consideration on tagging Phobos function as either GC or no-GC depending on how they behave for general awareness when reading the docs?
>>
>> I'm thinking it could be useful to know what you get.
>
> I wonder how much of Phobos is not @nogc simply because of the use of exceptions. Walter had some ideas that would allow exceptions to work without GC. Is there any progress?
Use compiler flag - dip1008 and only throw as
throw new SomeExceptionType(msgString)
to get @nogc-ness.
|
July 13, 2020 Re: GC/nogc status in docs | ||||
---|---|---|---|---|
| ||||
Posted in reply to SealabJaster | On Monday, 13 July 2020 at 12:38:05 UTC, SealabJaster wrote: > On Monday, 13 July 2020 at 11:16:07 UTC, aberba wrote: >> The >>> From what I have read,... >> is all over the place. > > Perhaps we need a sort of "mythbusting" page. > > " > MYTH: D's GC will **randomly** cause pauses in your program! > > FACT: D's GC only decides if it needs to run during allocations, and collections can be manually disabled for hot paths(GC.disable/GC.enable), as well as forced prematurely (GC.collect). > " > > And the like. It won't make a bit of difference. Walter wrote the original version of the GC page way back when [1] (pretty sure I read in in 2004 or so and, with my Java background, found it a refreshing attitude). Didn't matter. I started the GC series on the blog partly to counter misinformation here and on reddit. Didn't matter (I find an opportunity to link to it most D threads on reddit). Whether it's GC or any of the other complaints we hear about, it won't matter. There will always be some number of people who have a lot to say about why they aren't using D, or any language, and it very often is not the same list of complaints you get from those who actually are using it. This has been the same surrounding every language I've ever used. A mythbuster page isn't aimed at the people we need to reach. There are other ways to do that. Like, write games that use the GC and do a blog or video series on it. Write blog posts about real world D projects using the GC now, or focusing on any other D feature (what this algorithm or that container looks like in D, etc). Write about your own personal experience with D, the GC, Phobos, and so on. This is the sort of stuff that attracts interest. And the people it attracts aren't going to be the ones you see in reddit threads throwing up one excuse after another about why they aren't using D. The ones it attracts are those who mention two or three years later in a forum thread "I first came to D when I saw a blog post about it on reddit". I notice a lot of enthusiasm lately for promoting and evangelizing D, and that's a good thing! We will always need more material out there, yes. But IMO, it should be the sort of material that focuses on showing what D can actually do and how it's actually used as opposed to material that's purely promotional. We want people to stumble across it and think, "Hey, that's neat! I should check that out." It believe it also helps when addressing misinformation directly in reddit/HN comments that we shouldn't argue or debate. Just lay some facts down, with links if necessary, and walk away. Only reply to responses that are crying out for more laying down of facts, but do so sparingly. Your target audience should rarely be the person you're replying to, whose mind you are almost certainly not going to change, but people reading the comment thread at any point in time thereafter. [1] https://dlang.org/spec/garbage.html |
July 13, 2020 Re: GC/nogc status in docs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ogi | On Monday, 13 July 2020 at 18:14:56 UTC, Ogi wrote:
> On Thursday, 9 July 2020 at 12:55:45 UTC, aberba wrote:
>> Has there been any consideration on tagging Phobos function as either GC or no-GC depending on how they behave for general awareness when reading the docs?
>>
>> I'm thinking it could be useful to know what you get.
>
> I wonder how much of Phobos is not @nogc simply because of the use of exceptions. Walter had some ideas that would allow exceptions to work without GC. Is there any progress?
You can enable @nogc exceptions with -preview=dip1008. Last I heard there were some issues with the implementation, but that was a while ago, so things may have changed.
|
July 13, 2020 Re: GC/nogc status in docs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mike Parker | On Monday, 13 July 2020 at 19:16:31 UTC, Mike Parker wrote: > On Monday, 13 July 2020 at 12:38:05 UTC, SealabJaster wrote: >> On Monday, 13 July 2020 at 11:16:07 UTC, aberba wrote: >>> The >>>> From what I have read,... >>> is all over the place. >> >> Perhaps we need a sort of "mythbusting" page. I remember one Linux OS project did this and really made an impact. [1] > I started the GC series on the blog partly to counter misinformation here and on reddit. Didn't matter (I find an opportunity to link to it most D threads on reddit). Whether it's GC or any of the other complaints we hear about, it won't matter. Actually it did and still making more impact than you think. I see that post referenced in many places. Some do actually read to understand. Its actually a gem I use for the D preaching work. You're right, there are naysayers but also people with genuine interest in making a decision. 1. https://blog.elementary.io/busting-major-myths-around-elementary-os/ |
July 13, 2020 Re: GC/nogc status in docs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ogi | On Monday, 13 July 2020 at 18:14:56 UTC, Ogi wrote:
> On Thursday, 9 July 2020 at 12:55:45 UTC, aberba wrote:
>> Has there been any consideration on tagging Phobos function as either GC or no-GC depending on how they behave for general awareness when reading the docs?
>>
>> I'm thinking it could be useful to know what you get.
>
> I wonder how much of Phobos is not @nogc simply because of the use of exceptions. Walter had some ideas that would allow exceptions to work without GC. Is there any progress?
-dip1008 seems to work well enough.
But even when compiling with -dip1008, many exceptions in Phobos allocate a message string via the GC.
Moreover, many functions in std.exception rely on `lazy` parameters, which can't be inferred as @nogc, so any Phobos functions that use something like `enforce`, or `ifThrown` aren't @nogc.
See this example of something trivial which won't compile as @nogc even with -dip1008:
import std.exception;
void main () @nogc
{
int x = 5;
enforce(x <= 4);
}
|
July 13, 2020 Re: GC/nogc status in docs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mike Parker | On Monday, 13 July 2020 at 19:16:31 UTC, Mike Parker wrote: > On Monday, 13 July 2020 at 12:38:05 UTC, SealabJaster wrote: > It believe it also helps when addressing misinformation directly in reddit/HN comments that we shouldn't argue or debate. Just lay some facts down, with links if necessary, and walk away. Only reply to responses that are crying out for more laying down of facts, but do so sparingly. Your target audience should rarely be the person you're replying to, whose mind you are almost certainly not going to change, but people reading the comment thread at any point in time thereafter. Good advice Mike. I believe its a much better approach. > > [1] https://dlang.org/spec/garbage.html |
Copyright © 1999-2021 by the D Language Foundation