Show newer

bugs.llvm.org/show_bug.cgi?id=

standard doesn't say, blah blah blah... well standard should say, gcc is obviously right here by any definition of sanity, fix it already, how hard can it be?! :V

meanwhile we work around I guess -_-
godbolt.org/z/vaYzExa9d

Show thread

do i pin another unanswered question, or do I answer it and move on?

@iron_bug the thread is borked on my side, i guess cause you didn't tag? had to jump over to poast to read it...

> just the minimal set of keywords and language constructions enough to write everything

that's the philosophy, the realization didn't go so well though, cause it turns out even basic arithmetic is hard to get right, but sure lets pretend that it's all perfect, it's my fault that i didn't know that I can't multiply unsigned shorts...

@mew27 @Pat

nevermind, my monitor wasn't at its native refresh rate, which is about 75hz, with 82hz peaks and 72hz troughs... such natural, very nativity OvO ... compared to 60hz default which came up to near constant 59.9hz at all times... absolutely artificial :<

Show thread

@iron_bug to you any quirk of C is the word of god, so not sure what to argue here... just look up "quirks of C language"? Plenty of results.

Since we're doing arithmetic here suffice it to say:
unsigned short * unsigned short = insta-undefined-behavior-trollface

Also 2[a] is definitely syntax sugar for puppies only, I agree.

@Pat @mew27

@Pat same philosophy, same quirky realization, same syntax, same primitives, same usage patterns... if you like one you'll like the other, sans prejudice.

@mew27

are there any options for graphics on x11 other than tearing or stuttering? is this why wayland is a thing?

game: has unique and interesting control scheme

gamers: nooo, the controls are not exactly the same as every other reskin of the one actual game i play, so I can't live out my power fantasies without putting any effort into it, uplayable! I’ll have you know I graduated top of my class in counter-stike...

@ercadio great, now I have to generalize on the pointer type to allow different ownership models...

C baggage to unlearn: in-place operators return a reference to the object

@pleb@hunk.city I gave the counter a try, and seems like I need {a+=b; return a;} for the optimizations to kick in, then for both cases there's a single copy in your example. If you pass a temporary as a first parameter though, you'll get a move instead of a copy with add2, and for that reason it's a general rule of thumb in modern c++: if you know you need a copy - pass by value. That said there is a bigger semantic difference there that I had in mind.

@mew27 only if you are a true javascript fanboi

@mew27 understandable, after all javascript is C for pussies...

1 + {} = "1[Object object]"

@Pat nah no shenanigans like that, there is difference between the two as written.

@freemo @pleb@hunk.city

@freemo Not entirely sure about performance characteristics myself, good hunch that the differences are minor, but as far as I know add2 can actually be faster in some cases, if you take optimizations in consideration, and the reason it could be slower is not at all what you suggest, it usually is about construction and copying of objects.

There is a notable functional difference though, but not gonna hint too hard for now.

Show older
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.