Reviving Phobos

Dmitry Olshansky dmitry.olsh at gmail.com
Tue Apr 11 17:56:22 UTC 2023


On Tuesday, 11 April 2023 at 17:49:55 UTC, Richard (Rikki) Andrew 
Cattermole wrote:
> *whispers* https://github.com/Project-Sidero/basic_memory
>

I allocate all of my memory at startup in Photon.

> Currently being working on: 
> https://github.com/Project-Sidero/eventloop
>
> However my stuff won't help you. I want more guarantees, not 
> less. Yes it is -betterC, which only drives it harder. Since 
> you don't want this to be valid D:
>
> ```d
> MyRef myRef = ...;
> auto mem = myRef.get;
> myRef.destroy;
> //use mem
> ```

Manual refcounting been there done that.

> Not only could that not segfault, but it could still have valid 
> data in mem's memory. Which is a very scary possibility.
>
> I gotta say what I've been able to build so far is very 
> impressive. Having dmd build DLL's that look and feel like 
> regular in binary code? (ok ignoring a few workarounds...). 
> Along with supporting druntime in executable, with GC and 
> druntime thread integration? Muhaha.

Cool.

>
>
> But as far as fibers are concerned? Kill them off. They are a 
> target + platform + system C compiler ABI hack. They waste GC 
> time scanning memory which has no valid data in it.
>
> The solution should be coroutines.

I like coroutines in Kotlin for that matter, the only downside is 
suspendable vs nonsuspendable functions.


>
> In terms of Phobos itself, it just needs leadership. After all, 
> how many years has it been since we found out that console 
> support on Windows should NOT be done with C standard IO? Cos 
> that would be an easy module to write up.

Yup.

—
Dmitry Olshanky


More information about the Digitalmars-d mailing list