Things that make writing a clean binding system more difficult

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 5 10:33:39 PDT 2016


On 8/5/16 6:17 AM, Manu via Digitalmars-d wrote:
> On 5 August 2016 at 03:33, Seb via Digitalmars-d
> <digitalmars-d at puremagic.com> wrote:
>> On Thursday, 4 August 2016 at 12:44:49 UTC, Manu wrote:
>>>
>>> On 29 July 2016 at 16:51, Jonathan M Davis via Digitalmars-d
>>> <digitalmars-d at puremagic.com> wrote:
>>>>
>>>> [...]
>>>
>>>
>>> Bingo! But it's much deeper than that. ref is a disaster. Use it to
>>> any real extent; in particular, binding (or fabricating bindings) to
>>> extern(C++) code, and you will see just how fast it breaks down in the
>>> most horrific of ways (almost always resulting in text mixin). I would
>>> fork D just to fix ref!
>>
>>
>> I might sound stupid, but there is a better way than forking:
>>
>> 1) Work out a _good_ D improvement proposal and submit it for review to
>> https://github.com/dlang/DIPs (exact process is explained over there)
>> 2) Once accepted, send a PR
>
> Solution is trivial; ref is part of the type. Of course this will
> break a ton of code, and it's strongly resisted. It'll never happen
>> _<

Another solution is to make a Ref smart pointer type. But there isn't 
enough support from the language yet.

-Steve


More information about the Digitalmars-d mailing list