November 11, 2019 Re: Is there any writeln like functions without GC? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ferhat Kurtulmuş | On Saturday, 9 November 2019 at 22:03:03 UTC, Ferhat Kurtulmuş wrote: > On Thursday, 31 October 2019 at 03:56:56 UTC, lili wrote: >> Hi: >> why writeln need GC? > > Upon this post, I thought writing a gc-free writeln would be a good learning practice. Although it is not a feature-complete one, it was a lot of fun to do it :) > > https://github.com/aferust/stringnogc If you wanted to follow the standard of D then you didn't need a string type. Since it doesn't really exist in D. string is just an alias for immutable(char)[] So what you want is to use this: https://dlang.org/phobos/std_container_array.html |
November 12, 2019 Re: Is there any writeln like functions without GC? | ||||
---|---|---|---|---|
| ||||
Posted in reply to bauss | On Monday, 11 November 2019 at 16:20:59 UTC, bauss wrote:
> If you wanted to follow the standard of D then you didn't need a string type. Since it doesn't really exist in D.
>
> string is just an alias for immutable(char)[]
And that is why std.exception.assumeUnique converts char[] to string AKA immutable(char)[].
|
November 12, 2019 Re: Is there any writeln like functions without GC? | ||||
---|---|---|---|---|
| ||||
Posted in reply to lili | If your goal is to debug your @nogc code, you can use writeln in debug statement: @nogc void main() { debug writeln("hello, debug world!"); } |
November 14, 2019 Re: Is there any writeln like functions without GC? | ||||
---|---|---|---|---|
| ||||
Posted in reply to dangbinghoo | On Sunday, 10 November 2019 at 07:57:38 UTC, dangbinghoo wrote:
> On Sunday, 3 November 2019 at 05:46:53 UTC, 9il wrote:
>> On Thursday, 31 October 2019 at 03:56:56 UTC, lili wrote:
>>> Hi:
>>> why writeln need GC?
>>
>> See also Mir's @nogc formatting module
>>
>> https://github.com/libmir/mir-runtime/blob/master/source/mir/format.d
>
> hi, is mir right now fully implemented using betterC?
>
> thanks!
> --
> binghoo
Nope, but you can write a lot of things that would not require to link with DRuntime.
The betterC flags also means that you can't use DRuntime during compilation, which makes D generics almost useless.
|
Copyright © 1999-2021 by the D Language Foundation