January 13, 2024

On Friday, 12 January 2024 at 23:03:20 UTC, Adam Wilson wrote:

>

On Friday, 12 January 2024 at 11:04:09 UTC, claptrap wrote:

>

So im not sure if it matters if average joe has a misunderstanding about what nogc does (im not sure they actually do either tbh), but the people who actually really need it have to understand it and a lot more on top.

So "average joe doesnt understand nogc therefor its useless" is a strawman IMO.

If it doesn't matter, or they really do know, then please present an alternative theory as to why we keep having the same misunderstandings over @nogc.

I just went through 9 months of the learn group, i didn't find any posts regarding nogc being confusing, just few post on why certain functions can't be called with nogc.

I'm saying I dont see lots of people who are confused about nogc.

>

Small problem, I didn't raise a strawman, you did. I never said it was useless.

Yeah sorry, you're right.

January 13, 2024

On Saturday, 13 January 2024 at 00:22:25 UTC, claptrap wrote:

>

I'm saying I dont see lots of people who are confused about nogc.

I see people who confuse it with an imaginary @noAlloc on a regular basis.

January 13, 2024
On Thursday, 11 January 2024 at 13:07:52 UTC, deadalnix wrote:
> the quality of syntax highlighting for D has degraded significantly

For code-d it improved in my experience. Although, the switch to a different grammar around 2017ish brought a bunch of quirks, the overall experience got better. And some of said quirkiness has been vetted.

Syntax highlighting for D has been pretty disappointing in general (across all implementations) ever since in the first place.
In my perception, it is as it has always been: Better than no highlighting.
…I think this summarizes it quite well.
January 13, 2024
On Thursday, 11 January 2024 at 17:08:50 UTC, Dejan Lekic wrote:
> Now watch this thread grow into oblivion with more than 100 replies...

I’m impressed. /s
Not even two weeks into 2024 and we’ve already got two threads on the newsgroup that could qualify as yet another “crybaby thread”.
January 12, 2024
On 1/12/2024 3:13 PM, Timon Gehr wrote:
> On 1/12/24 21:52, Walter Bright wrote:
>> On 1/12/2024 6:54 AM, Timon Gehr wrote:
>>> Do you think virtual methods and runtime delegates were a mistake in general?
>>
>> I don't like opApply() because it does a hidden rewrite of the statements in the function that makes the semantic analysis fragile, ugly and clumsy.
>>
>> I'm a bit amazed it works at all :-/
>>
>> Virtual methods and runtime delegates don't have this problem.
> 
> My own `opApply` implementation is relatively straightforward:
> 
> https://github.com/tgehr/d-compiler/blob/master/semantic.d#L8868-L8915
> https://github.com/tgehr/d-compiler/blob/master/semantic.d#L9174-L9227
> https://github.com/tgehr/d-compiler/blob/master/semantic.d#L9882-L9889
> https://github.com/tgehr/d-compiler/blob/master/semantic.d#L9972-L9985
> https://github.com/tgehr/d-compiler/blob/master/semantic.d#L10037-L10047
> https://github.com/tgehr/d-compiler/blob/master/semantic.d#L10059-L10064

I'm not sure if it is straightforward or not! Consider that the original implementation was implemented in C-with-Classes, not D templates!
January 12, 2024
On 1/12/2024 5:35 PM, Elias (0xEAB) wrote:
> Syntax highlighting for D has been pretty disappointing in general (across all implementations) ever since in the first place.
> In my perception, it is as it has always been: Better than no highlighting.
> …I think this summarizes it quite well.

My editor (microEmacs) pretends to do syntax highlighting by simply showing keywords, comments, text, and string literals in different colors. I had to switch it to muted colors because the durn thing presented like a Christmas tree.

I kinda enjoy the look, but am unsure of its value.
January 13, 2024
On 1/11/2024 2:32 PM, Timon Gehr wrote:
> On 1/11/24 22:37, Walter Bright wrote:
>>
>> Logical const code cannot take advantage of it being const because it isn't constant.
> 
> Well, people can and do do it.
> 
> https://issues.dlang.org/show_bug.cgi?id=9149
> 
> I have had to debate people on whether or not this is even a bug because they had been relying on the behavior in order to implement logical `const`.

It is a bug, and as the issue shows, there is a solution.
January 13, 2024
On 1/11/2024 2:49 PM, Guillaume Piolat wrote:
> pure is especially annoying because no escape hatch.

There is. You take a pointer to the pure code, can forcibly cast it to an impure pointer. However, that only works in @system code. There's a `pureMalloc` somewhere in the library that does this.

The same technique can be used to remove @nogc.

But when one subverts the type system like that, one must own the consequences.

BTW, `pure` is not enforced within `debug` blocks. This is handy so they can be instrumented with things like `printf`.

January 13, 2024
On 1/11/2024 2:32 PM, Timon Gehr wrote:
> https://issues.dlang.org/show_bug.cgi?id=9149


I added the `safe` keyword so anyone looking for safety issues can find it.
January 13, 2024

On Saturday, 13 January 2024 at 01:25:51 UTC, Elias (0xEAB) wrote:

>

On Saturday, 13 January 2024 at 00:22:25 UTC, claptrap wrote:

>

I'm saying I dont see lots of people who are confused about nogc.

I see people who confuse it with an imaginary @noAlloc on a regular basis.

What is it that they expect it to do?