Tasks, actors and garbage collection
Ola Fosheim Grøstad
ola.fosheim.grostad at gmail.com
Tue Apr 20 21:22:22 UTC 2021
On Tuesday, 20 April 2021 at 16:28:46 UTC, russhy wrote:
> GC is not the right model if you don't have the same ressources
> as Microsoft / Google / Oracle to invest massively on GC R&D,
> there is no way D can comepte with the latest Java's sub 1ms
> GC, no way
Well, it would be 0ms, if it runs when the task is idle. If the
task is short lived then it would be like an arena-allocator
(faster than malloc).
> IMHO, Apple made the right decision to go with a RC with Swift,
> like they did with Obj-C
The people who were unhappy with D having a GC has probably left
for Rust at this point. So it seems like the majority wants to
have a GC.
> D's future is with memory ownership / reference counting
If it keeps moving at this pace then it will never happen... and
the language semantics for borrowing isn't there.
> We need to transition to RC instead of GC, the sooner, the
> better
Yes, if it had happened 4 years ago, but it is kinda too late. If
there had been traction in the community for making everything RC
then things wouldn't move so slowly with memory management as it
does now. Borrowing won't happen either, for it to happen there
should've been a gamma-release by now. It will take years to get
it to work properly after the first gamma-release.
GC-based tasks should make converting existing code reasonable in
most cases. Except for heavily user-level multithreaded code.
It can also be done as a prototype in short order. Just adapt the
existing GC code, even though that might be a bit heavy for
production use.
More information about the Digitalmars-d
mailing list