May 15, 2012
On 15-05-2012 15:22, Gor Gyolchanyan wrote:
> On Tue, May 15, 2012 at 4:00 PM, Alex Rønne Petersen
> <xtzgzorex@gmail.com <mailto:xtzgzorex@gmail.com>> wrote:
>
>
>     Yes, because using a Phobos function in druntime is perfectly
>     possible! Totally!
>       --
>     - Alex
>
>
> Isn't it obvious what needs to be done? Come on, it's no too hard to see...
>
>
> --
> Bye,
> Gor Gyolchanyan.

No, it should not be moved to druntime. druntime is the low-level abstraction layer over the compiler, nothing else.

Further, all the write* functions perform GC allocation, which is unacceptable in druntime.

-- 
- Alex
May 15, 2012
Even if it's wrong to move writef to druntime, the toUTFz is still a very small word to write.

On Tue, May 15, 2012 at 5:29 PM, Alex Rønne Petersen <xtzgzorex@gmail.com>wrote:

> On 15-05-2012 15:22, Gor Gyolchanyan wrote:
>
>> On Tue, May 15, 2012 at 4:00 PM, Alex Rønne Petersen <xtzgzorex@gmail.com <mailto:xtzgzorex@gmail.com>> wrote:
>>
>>
>>    Yes, because using a Phobos function in druntime is perfectly
>>    possible! Totally!
>>      --
>>    - Alex
>>
>>
>> Isn't it obvious what needs to be done? Come on, it's no too hard to see...
>>
>>
>> --
>> Bye,
>> Gor Gyolchanyan.
>>
>
> No, it should not be moved to druntime. druntime is the low-level abstraction layer over the compiler, nothing else.
>
> Further, all the write* functions perform GC allocation, which is unacceptable in druntime.
>
> --
> - Alex
>



-- 
Bye,
Gor Gyolchanyan.


May 15, 2012
On 15-05-2012 15:35, Gor Gyolchanyan wrote:
> Even if it's wrong to move writef to druntime, the toUTFz is still a
> very small word to write.
>
> On Tue, May 15, 2012 at 5:29 PM, Alex Rønne Petersen
> <xtzgzorex@gmail.com <mailto:xtzgzorex@gmail.com>> wrote:
>
>     On 15-05-2012 15:22, Gor Gyolchanyan wrote:
>
>         On Tue, May 15, 2012 at 4:00 PM, Alex Rønne Petersen
>         <xtzgzorex@gmail.com <mailto:xtzgzorex@gmail.com>
>         <mailto:xtzgzorex@gmail.com <mailto:xtzgzorex@gmail.com>>> wrote:
>
>
>             Yes, because using a Phobos function in druntime is perfectly
>             possible! Totally!
>               --
>             - Alex
>
>
>         Isn't it obvious what needs to be done? Come on, it's no too
>         hard to see...
>
>
>         --
>         Bye,
>         Gor Gyolchanyan.
>
>
>     No, it should not be moved to druntime. druntime is the low-level
>     abstraction layer over the compiler, nothing else.
>
>     Further, all the write* functions perform GC allocation, which is
>     unacceptable in druntime.
>
>     --
>     - Alex
>
>
>
>
> --
> Bye,
> Gor Gyolchanyan.

It's a Phobos function.

-- 
- Alex
May 15, 2012
On 05/15/2012 12:09 PM, Gor Gyolchanyan wrote:
> There's not reason to use printf! This is ridiculous! We haev a
> type-safe writef, which does exactly that and does it better.
> Besides, wrapping the literal into a toUTFz is not too difficult!
>

!!!!!!!!!!!!!!!!
May 15, 2012
No, no and no. toUTFz could be called at compile-time. Absolutely no extra run-time allocations, absolutely no run-time overhead.

On Tue, May 15, 2012 at 11:05 PM, Jonathan M Davis <jmdavisProg@gmx.com>wrote:

> On Tuesday, May 15, 2012 17:35:58 Gor Gyolchanyan wrote:
> > Even if it's wrong to move writef to druntime, the toUTFz is still a very small word to write.
>
> Using toStringz or toUTFz instead of having string literals be
> zero-terminated
> would force allocating extra strings (string literals are in an RO portion
> of
> memory - at least on Linux - so you can't append to them without
> reallocating).
>
> Making it so that string literals weren't null terminated would break a
> _lot_
> of code for little-to-no benefit and a definite cost. I really don't see
> the
> problem with "" being different from cast(string)[] - particularly when the
> fact that "" is non-null is _useful_.
>
> - Jonathan M Davis
>



-- 
Bye,
Gor Gyolchanyan.


May 15, 2012
Le 15/05/2012 15:29, Alex Rønne Petersen a écrit :
> On 15-05-2012 15:22, Gor Gyolchanyan wrote:
>> On Tue, May 15, 2012 at 4:00 PM, Alex Rønne Petersen
>> <xtzgzorex@gmail.com <mailto:xtzgzorex@gmail.com>> wrote:
>>
>>
>> Yes, because using a Phobos function in druntime is perfectly
>> possible! Totally!
>> --
>> - Alex
>>
>>
>> Isn't it obvious what needs to be done? Come on, it's no too hard to
>> see...
>>
>>
>> --
>> Bye,
>> Gor Gyolchanyan.
>
> No, it should not be moved to druntime. druntime is the low-level
> abstraction layer over the compiler, nothing else.
>
> Further, all the write* functions perform GC allocation, which is
> unacceptable in druntime.
>

I do agree that it does not belong to druntime.

However :
1/ druntime already perfom GC aloc.
2/ druntime isn't supposed to printf anyway.
May 15, 2012
On 5/15/12, Gor Gyolchanyan <gor.f.gyolchanyan@gmail.com> wrote:
> No, no and no. toUTFz could be called at compile-time. Absolutely no extra run-time allocations, absolutely no run-time overhead.

How about programmer-time overhead? Are *you* volunteering to edit all the codebases out there that rely on having 0-terminated string literals?
1 2
Next ›   Last »