September 03, 2022
On Thursday, 1 September 2022 at 19:45:08 UTC, IGotD- wrote:
>
> I previously saw an example that allocated the space in the class for the member class, unfortunately I cannot find it.

There's scoped:
https://dlang.org/library/std/typecons/scoped.html

Scroll down the example to the "Use as member variable" part. I assume it can be used as a class member too.
September 05, 2022
On Friday, 2 September 2022 at 19:54:44 UTC, Walter Bright wrote:
> On 9/2/2022 6:23 AM, Steven Schveighoffer wrote:
>> What do you mean? If you are suggesting that probably the module sorting is insignificant, it definitely is not very intensive.
>
> I am indeed suggesting it is insignificant.

If this can be done at compile time, there is no reason why it shouldn't. This is another task that should be done in D3.
September 05, 2022

On 9/2/22 3:54 PM, Walter Bright wrote:

>

On 9/2/2022 6:23 AM, Steven Schveighoffer wrote:

>

What do you mean? If you are suggesting that probably the module sorting is insignificant, it definitely is not very intensive.

I am indeed suggesting it is insignificant.

I'd hazard to guess it's indistinguishable really. Probably on the order of a couple milliseconds, even on a large module set.

It's not so much the performance, but the principle, and also the requirement of code to do something that is knowable really at link-time.

>

In the olden days, I (and others) would just have the executable self-patch itself. But such behavior was then banned by the OS.

I'm thinking more about either an intermediate step to the linker (once all objects are known), or a post-link step. Not something that happens at runtime.

What could happen is some --DRT switch to output the correct sorting, and then another tool that takes that as input, and can then properly edit the executable, or provide a specialized file to the compiler so it spits out a pre-organized module list. Can they be weak symbols, and then you just link the object file with that data ahead of everything else? Or, just the rt_init function could be told "use this pointer array as the list instead of the sorting."

Actually, I think that last idea is doable without any compiler changes... I'll have to investigate.

-Steve

1 2 3 4 5
Next ›   Last »