D Language 2.0

Leandro Lucarella llucax at gmail.com
Wed Jan 20 05:18:52 PST 2010


Andrei Alexandrescu, el 19 de enero a las 23:17 me escribiste:
> bearophile wrote:
> >Andrei Alexandrescu:
> >>I'd love -nogc. Then we can think of designing parts of Phobos
> >>to work under that regime.
> >
> >But you must do this with lot of care: programmers coming from C++ will
> >be tempted to write code that uses those GC-free parts of Phobos a lot,
> >the end result will be a lot of D code in the wild that's like C++ or
> >worse. So when you want to use one of those modules or libraries, you
> >may need to dance their no-GC dance. This can invalidate the good idea
> >of designing a GC-based language.
> >
> >A better strategy is first of all to improve a lot the D GC, if
> >necessary to introduce in the language other details to help the design
> >of a more efficient GC (like giving ways to tell apart pinned objects
> >from normal ones, make the unpinned ones the default ones, and modify
> >the type system so mixing pinned-memory and unpinned-memory pointers is
> >generally safe, etc). Only when further improvements to the GC become
> >too much hard, you can start to write no-GC parts of Phobos, few years
> >from now.
> >
> >I have seen many cases where Java code run with HotSpot is faster than
> >very similar D1 code compiled with LDC. Avoiding the GC is a easy
> >shortcut, but I think it's not a good long-term strategy for D.
> >
> >Bye,
> >bearophile
> 
> Walter and I talked for hours about a no-gc model for D, and the
> conclusion was that with only a little compiler support, things can
> be arranged such that swapping different object.d implementations,
> the entire D allocation model can be swapped between traditional GC
> and reference counting.

Again? RC is *not* -nogc, is -anothergc. And reference counting won't do
the trick unless you add a backing GC to free cycles. What I mean about
-nogc is *no* GC, is "please, mr compiler, give me an error when a GC
facility is used".

-- 
Leandro Lucarella (AKA luca)                     http://llucax.com.ar/
----------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------
<Damian_Des> Me anDa MaL eL CaPSLoCK



More information about the Digitalmars-d mailing list