June 18

On Monday, 17 June 2024 at 22:58:13 UTC, Atila Neves wrote:

>

On Thursday, 6 June 2024 at 18:00:56 UTC, Sebastiaan Koppe wrote:

>

I think DRT only needs to concern itself with supporting language features. Anything else needs to go elsewhere.

Same here, and that it should be pay-as-you-go and as small as possible. Anything else should be regular D code.

Ok, then were does the Event Loop go? Or the std.math methods that the compiler hooks? The basic problem with the premise is that you're effectively saying "we're never going to do more than DRT does today".

If we put this stuff directly into Phobos then we're back to a compiled library as we'll be linking other static/dynamic libraries in. Furthermore this is going to lead to an file-size explosion in DRT. Very likely what you end up with is a bunch of "internal" modules like std.concurrency.internal.windows which is basically the same thing as a putting them in DRT.

What we are proposing is is a PAYGO solution. There is a mini-runtime that is just the basics needed to allow the compiler to link code. After that there will be larger rings around the mini-runtime that support higher level features. If you're porting, you must port the mini-runtime or the app won't link, but if you don't port the higher level features, you just want be able to use them.

June 18

On Tuesday, 18 June 2024 at 06:12:53 UTC, Adam Wilson wrote:

>

On Monday, 17 June 2024 at 22:58:13 UTC, Atila Neves wrote:

>

On Thursday, 6 June 2024 at 18:00:56 UTC, Sebastiaan Koppe wrote:

>

I think DRT only needs to concern itself with supporting language features. Anything else needs to go elsewhere.

Same here, and that it should be pay-as-you-go and as small as possible. Anything else should be regular D code.

Ok, then were does the Event Loop go?

What event loop? Unless we add a language feature for this I don't see why it would belong in drt.

>

Or the std.math methods that the compiler hooks?

Intrinsics?

>

The basic problem with the premise is that you're effectively saying "we're never going to do more than DRT does today".

Not in drt itself, no. But why would we have to?

June 19
On 19/06/2024 5:29 AM, Atila Neves wrote:
>     Ok, then were does the Event Loop go?
> 
> What event loop? Unless we add a language feature for this I don't see why it would belong in drt.

Adam is using different meanings to terminology we use.

A runtime in literature can also refer to the standard library, I did warn him about this particular confusion as it does not match the D communities understanding of the word.

Basically what he is suggesting is that there is a series of libraries starting from what is needed to make ``new`` clean up (it doesn't have to), eventloop and other core dependencies that things in our standard library require to have a binary linked against for.

Either way it needs a binary to be inside of. Regardless of if we call it part of phobos or druntime. It can't live as an import only library.
June 19
Atila Neves kirjoitti 18.6.2024 klo 20.29:
> 
> Not in drt itself, no. But why would we have to?
> 
> 

He already explained it in the original post:

> The most often given reason for keeping DRT as-is is that “we only need to port DRT to a new platform, Phobos is platform independent.” I submit that this is factually incorrect. There are currently 31 files in Phobos with `version (WinXXXX)` statements in them. 14 with `version (linux)`. And IIRC everybody who has tried a port D to a new platform recently has just not bothered to port Phobos at all. To be sure, some of these version statements are benign, but take a look at `std.stdio`, I wish whoever wants to port that much luck in their endeavors. It has 32 instances `version (WinXXXX)` alone. And that is our basic I/O module.
> 
> [snip]
> 
> An example of why this matters is found in `std.stdio`. We currently use the C Runtime to do basic I/O operations. While that works and is expedient, it limits us. For example, doing colored terminal output is so difficult nobody does it, or, we are limited to the C file interface, etc. To gain access to more advanced capabilities, we need to use the system API’s, but these are diverse, and putting them in Phobos would significantly expand the code required and make maintenance a nightmare. What is interesting about this is that, in fact, D has two runtimes. The C Runtime, which we use as a universal system interface, and the DRT which is a bunch of compiler support tools that the CRT doesn’t have. 

To do IO in a modern way (as opposed to the standard C way) an event loop is probably needed.

If you read the rest of his post, you can see it's arguable if he is actually suggesting doing that in the runtime. He is suggesting to "shard" the runtime so that there would be a core "shard" that does what the runtime does now, and other shards that do stuff like event loop, io, file access primitives and so on, so that Phobos could be built on those without platform-specific code in it. Those other shards would all be optional, so that if you don't use them (or parts of Phobos or other libraries that depend on them), you could still write D on platform the optional shards aren't ported to.

When Adam writes about the runtime, he means all the proposed shards. I personally feel runtime should only mean the core shard, but this is only a difference in terminology. Either way, the proposal is to implement the event loop in one of the optional shards, not the core shard.
July 03

On Wednesday, 5 June 2024 at 23:58:14 UTC, Adam Wilson wrote:

>

The most often given reason for keeping DRT as-is is that “we only need to port DRT to a new platform, Phobos is platform independent.” I submit that this is factually incorrect. There are currently 31 files in Phobos with version (WinXXXX) statements in them. 14 with version (linux). And IIRC everybody who has tried a port D to a new platform recently has just not bothered to port Phobos at all.

By the way, I’ll answer as one of these persons: it will just be a waste of time!

Because how it need to be ported very much depends on the decision made about how we reorganize the druntime at first.

October 17

On Tuesday, 11 June 2024 at 11:38:40 UTC, Dmitry Olshansky wrote:

>

On Tuesday, 11 June 2024 at 09:25:15 UTC, Adam Wilson wrote:

>

On Monday, 10 June 2024 at 09:36:14 UTC, Dmitry Olshansky wrote:

> >

No other language suffers this problem, not even Go. The reason is that all languages that successfully use Fibers, use dynamically expanding stacks, but this means using a precise stack-scanning moving GC.

Far as I can tell Go dropped segmented stacks I cannot tell if they copy the stack around.

FWIW:

(a reply to an old thread, but I did not see this noted in the thread)

While Go has a precise GC, the GC does not move any items once they're in the heap.

As to stack growth, once the segmented stacks were dropped, it switched to a scheme of doubling the size of stacks. So a new stack is allocated, the contents of the old stack copied to it, and any pointers in to the stack (which can only be from elsewhere in the stack) are fixed up. That depends upon the same precise info which the GC uses.

So the stack does move when it grows, and be fixed up. However that is not done by the GC.

The stack can point in to the heap, the heap can not point in to the stack.

DF

1 2 3 4 5
Next ›   Last »