April 22
On 22/04/2024 9:55 AM, Brad Roberts wrote:
> Before github we used dsource.org and subversion:
>      http://dsource.org/projects/druntime/browser
> 
> It looks like the history on github retains that history, which matches with my memory of how we transitioned over.  The history seems to start at about 2008.
> 
> What I'm not seeing is much pre-D2 history.  There's some, but I thought I'd built up a full D1 history, or mostly full -- at least a per-release snapshot.  Did those early release tarball/zips not contain the druntime code maybe?
> 
> On 4/21/2024 1:58 PM, Walter Bright via Digitalmars-d wrote:
>> Quite an awesome bit of detective work! A fine and most entertaining read it is. I recommend you include that text in any PR to fix it.
>>
>>  > So maybe, the solution Walter came up with (and I'm just guessing here), is hey, we are shutting down anyways, just avoid scanning the main thread stack, and we can satisfy the unwashed masses.
>>
>> If I did write that function, I don't remember doing so, or why I would. Unfortunately, D1 predates our use of github, so it wouldn't be easy trying to figure out who wrote that.

The oldest version of D that is in the release archive is 0.5, which has it.

That is from 17/11/2002

So wayyyyy before dsource.
April 21
On 4/21/2024 2:58 PM, Richard (Rikki) Andrew Cattermole via Digitalmars-d wrote:
> On 22/04/2024 9:55 AM, Brad Roberts wrote:
>> Before github we used dsource.org and subversion:
>>      http://dsource.org/projects/druntime/browser
>>
>> It looks like the history on github retains that history, which matches with my memory of how we transitioned over.  The history seems to start at about 2008.
>>
>> What I'm not seeing is much pre-D2 history.  There's some, but I thought I'd built up a full D1 history, or mostly full -- at least a per-release snapshot.  Did those early release tarball/zips not contain the druntime code maybe?
>>
>> On 4/21/2024 1:58 PM, Walter Bright via Digitalmars-d wrote:
>>> Quite an awesome bit of detective work! A fine and most entertaining read it is. I recommend you include that text in any PR to fix it.
>>>
>>>  > So maybe, the solution Walter came up with (and I'm just guessing here), is hey, we are shutting down anyways, just avoid scanning the main thread stack, and we can satisfy the unwashed masses.
>>>
>>> If I did write that function, I don't remember doing so, or why I would. Unfortunately, D1 predates our use of github, so it wouldn't be easy trying to figure out who wrote that.
> 
> The oldest version of D that is in the release archive is 0.5, which has it.
> 
> That is from 17/11/2002
> 
> So wayyyyy before dsource.

Ok, the older code is in the phobos repository and goes back to phobos 0.1.  I did that import, and the commit is dated september 9, 2007.  The exact same history as on dsource.org for phobos, just to double check. So, that's the best history that Walter was able to dig up for me.

So, it's been there that way from the earliest history I ever saw.
April 22
On 22/04/2024 9:58 AM, Richard (Rikki) Andrew Cattermole wrote:
> The oldest version of D that is in the release archive is 0.5, which has it.
> 
> That is from 17/11/2002
> 
> So wayyyyy before dsource.

Found an even older one!

dmdalpha19.zip from ftp.digitalmars.com

Contains fullcollectNoStack still.

But this time its in C.

Also:

```
//
// Copyright (C) 2001 by Digital Mars
// All Rights Reserved
// Written by Walter Bright
// licensed to Chromium Communications
```

Interesting header.

I've gone through that ftp server. Doesn't appear to be anything older.

At this point somebody is gonna have to get lucky, perhaps booting up some old machines or backups.
April 22
On 22/04/2024 10:26 AM, Richard (Rikki) Andrew Cattermole wrote:
> On 22/04/2024 9:58 AM, Richard (Rikki) Andrew Cattermole wrote:
>> The oldest version of D that is in the release archive is 0.5, which has it.
>>
>> That is from 17/11/2002
>>
>> So wayyyyy before dsource.
> 
> Found an even older one!
> 
> dmdalpha19.zip from ftp.digitalmars.com
> 
> Contains fullcollectNoStack still.
> 
> But this time its in C.
> 
> Also:
> 
> ```
> //
> // Copyright (C) 2001 by Digital Mars
> // All Rights Reserved
> // Written by Walter Bright
> // licensed to Chromium Communications
> ```
> 
> Interesting header.
> 
> I've gone through that ftp server. Doesn't appear to be anything older.
> 
> At this point somebody is gonna have to get lucky, perhaps booting up some old machines or backups.

I've been able to find an alternative GC implementation.

August 21 2002, https://web.archive.org/web/20170913015932/http://opend.org/

Unfortunately that GC doesn't look like alpha19.zip's and that is older as its from February 8 2002.

So that is a complete dead end (it doesn't have it).

Welp I'm out of ideas, looks like that is it.
April 22

On Sunday, 21 April 2024 at 19:57:04 UTC, Daniel N wrote:

>

Why do we even support destructors for GC allocated objects? You can't depend on it closing file-descriptors or other resources.

You can't depend on the GC running. But if for some reason it does get run, why wouldn't you close the resource instead of leaking it?

Note that even if you are cleaning up the descriptor manually, using destroy is a valid mechanism.

I used destructors to close things like this a long time ago in a project and it worked OK.

-Steve

April 22

On Sunday, 21 April 2024 at 21:55:32 UTC, Brad Roberts wrote:

>

Before github we used dsource.org and subversion:
http://dsource.org/projects/druntime/browser

It looks like the history on github retains that history, which matches with my memory of how we transitioned over. The history seems to start at about 2008.

What I'm not seeing is much pre-D2 history. There's some, but I thought I'd built up a full D1 history, or mostly full -- at least a per-release snapshot. Did those early release tarball/zips not contain the druntime code maybe?

druntime was D2 only. D1 never supported druntime if I recall correctly. If you wanted what was in druntime, you used Tango (because that's where druntime came from). Remember that druntime is the attempt to be able to have both D2 phobos and Tango using the same runtime (this was the big problem with using both Tango and phobos libs -- incompatible runtimes).

For non-Tango D1, the runtime code was all in phobos.

So if you look at Tango history you will find where it comes from. I traced it all the way back from the beginning, where it was copied from D1 phobos (which had the function as I showed). Once I found it always was nostack, I just stopped going back.

I was going to start looking at dsource for tango history, but remembered there was a D2 port which also has the D1 history ;)

-Steve

April 22
On 22/04/2024 9:21 AM, Richard (Rikki) Andrew Cattermole wrote:
> On 22/04/2024 9:07 AM, Walter Bright wrote:
>> On 4/21/2024 1:01 PM, Richard (Rikki) Andrew Cattermole wrote:
>>> I can't even get Walter to agree to have RC in the language (even if it is reluctantly), let alone that...
>>
>> A few years back, we really tried to find a way to do it that was memory safe. We failed. Timon presented us with a use-after-free case that we couldn't resolve. Re-orienting D around a memory-unsafe construct is not the future for D.
>>
>> There's also the problem that the decrement has to be in a finally block, because of exceptions, which makes things bloated and slow.
> 
> I suspect that I need to learn more about the exception hooks.
> 
> My current understanding is that there is a subset that are entirely optional and are only needed to be called if cleanup occurs. Not quite the same thing as an exception catch.

After reviewing Windows documentation and assembly for linux, it appears my previous understanding is correct.

You only have to deal with cleanup which is checked for anyway, if you throw an exception.

So in other words, slow path only. I don't understand the issue here.

It is equivalent to a struct stored on the stack having its destructor called when an exception is thrown.
April 22

On Sunday, 21 April 2024 at 19:28:11 UTC, Steven Schveighoffer wrote:

>

So I am helping to add a new GC to dlang, and one thing I have run into is that all correctly-written GC implementations must implement the function collectNoStack.

...A couple hundered lines removed...

>

https://github.com/dlang/dmd/pull/16401

If there are any good reasons why we should have this, or I got something wrong, please let me know!

-Steve

Beautiful! I love to see software archaeology in action. Are those the only serious WTFs so far?

--John

April 22
On 4/21/24 21:57, Daniel N wrote:
> On Sunday, 21 April 2024 at 19:28:11 UTC, Steven Schveighoffer wrote:
> 
> Why do we even support destructors for GC allocated objects? You can't depend on it closing file-descriptors or other resources.
> 
> 
> 

Closing non-memory resources is not the only use case for destructors on GC-allocated objects. Another use case is freeing non-GC-allocated memory that the object encapsulates. Non-deterministic destruction is perfectly fine for such a use case. An example of this in Phobos is std.zlib.Compress.

April 22

On Sunday, 21 April 2024 at 19:28:11 UTC, Steven Schveighoffer wrote:

>

To try and pin down why this is there, and what the "popular demand" note means, I started using git blame (I have to say, the world is a better place with git and github around, I shudder to think how I would have had to find the history of this with subversion).

Hey! dsource.org is still alive! ;-)

http://www.dsource.org/projects/phobos/browser/branches/phobos-1.x/phobos

http://www.dsource.org/projects/tango/browser/trunk