|
Jaded Burnout posted:Ah, a nihilist itym "nullhilist"
|
# ? Oct 12, 2018 22:00 |
|
|
# ? May 20, 2024 23:58 |
|
When you see code checking for NaNs, it is usually either really clever code or really stupid code.
|
# ? Oct 15, 2018 20:49 |
Except that clever code is usually secretly bad code, so realistically any code checking for NaNs is bad
|
|
# ? Oct 15, 2018 21:03 |
|
Athas posted:When you see code checking for NaNs, it is usually either really clever code or really stupid code. you repeat yourself
|
# ? Oct 15, 2018 21:26 |
|
Athas posted:When you see code checking for NaNs, it is usually either really clever code or really stupid code. or it's javascript, where it's really easy to end up with NaNs. javascript doesn't throw an exception for a divide by zero, it just turns the number into NaN, so unfortunately NaN checking is completely justified in javascript.
|
# ? Oct 15, 2018 23:36 |
|
That's a lot of words to say "stupid code" again
|
# ? Oct 16, 2018 00:33 |
|
I tend to check NaNs and infs in functions that can diverge or otherwise blow up just so I can panic and fix it right away instead of running the computation for a day only to stop it and see "... oh, everything got polluted to NaN". IMO, checking for NaNs and infs before sorting is also good because otherwise floats are only a partial order. It's not a huge deal because you can filter them out afterwards anyway, and if NaNs or infs ended up in your list something else is probably very wrong, but I just feel like it's bad practice to sort a list that may contain elements that symmetrically compare false. Basically, unless things are super performance sensitive I find checking for NaNs very good, especially in numeric computing. Not to do anything with them, but so you can blow up early instead of it just silently polluting everything while your program runs for hours or days.
|
# ? Oct 16, 2018 01:35 |
|
ChickenWing posted:Except that clever code is usually secretly bad code, so realistically any code checking for NaNs is bad Nan checking is necessary for any decently sized game engine, usually around skeletal animation code because it’s pretty easy to end up with singular matrices. Or really any time you’re deserializing game assets because certain programs have no problem spewing nans when an artist accidentally mangles a mesh.
|
# ? Oct 16, 2018 04:21 |
|
Athas posted:When you see code checking for NaNs, it is usually either really clever code or really stupid code. Sounds like somebody's never written a quadratic program solver....
|
# ? Oct 16, 2018 05:17 |
|
ChickenWing posted:Except that clever code is usually secretly bad code, so realistically any code checking for NaNs is bad Or it's code, good or bad, dealing with data produced by bad code
|
# ? Oct 16, 2018 05:31 |
|
ultrafilter posted:Sounds like somebody's never written a quadratic program solver.... I work with lots of numerical code. That's exactly what I mean! Plenty of well written numerical code does carefully chosen things with NaNs, but also plenty of stupid code does ridiculous things with NaNs. They are a really elegant part of IEEE 758 (albeit with some warts), but now they show up in all kinds of places where they probably should not be.
|
# ? Oct 16, 2018 07:56 |
|
Thread is leaking: P1152R0 Deprecating volatile.
|
# ? Oct 16, 2018 07:57 |
|
Seems fine. It's not actually about deprecating volatile, just the insane person stuff that's technically allowed:code:
|
# ? Oct 16, 2018 08:53 |
|
Goreld posted:Nan checking is necessary for any decently sized game engine, usually around skeletal animation code because it’s pretty easy to end up with singular matrices. Or really any time you’re deserializing game assets because certain programs have no problem spewing nans when an artist accidentally mangles a mesh. those shreddie nans get everywhere https://www.youtube.com/watch?v=PshB7QYMINM
|
# ? Oct 16, 2018 12:55 |
|
It's beautiful:code:
|
# ? Oct 16, 2018 13:15 |
|
Now write a unit test for every possible int value and watch the coverage metric go through the roof!
|
# ? Oct 16, 2018 15:26 |
|
boo_radley posted:Thread is leaking: P1152R0 That Table of Contents is something...special. https://forums.somethingawful.com/showthread.php?threadid=3836768 EDIT: oh god it's the whole paper too. ulmont fucked around with this message at 17:46 on Oct 16, 2018 |
# ? Oct 16, 2018 17:39 |
|
boo_radley posted:Thread is leaking: P1152R0 quote:volatile-qualification of member functions was added to C++ to parallel const-qualification. Unlike const-qualification this never truly got used except for odd cases such as [ALEXANDRESCU]. [DE] is clearly uncertain about whether volatile-qualification of member functions is warranted. This mis-feature is either a heavy burden on Generic Programming, or something Generic Programming purposely avoids supporting because it often doubles the (already chatty) amount of Generic code. Preach it brother
|
# ? Oct 16, 2018 17:51 |
|
Linear Zoetrope posted:I tend to check NaNs and infs in functions that can diverge or otherwise blow up just so I can panic and fix it right away instead of running the computation for a day only to stop it and see "... oh, everything got polluted to NaN". Looking at you, C#, where NaN spreads like a plague.
|
# ? Oct 16, 2018 19:17 |
|
Ranzear posted:Looking at you, C#, where NaN spreads like a plague. What does C# do different than any other language? Is there any language where NaNs do not behave in the usual viral IEEE 754 way?
|
# ? Oct 16, 2018 21:04 |
|
Athas posted:What does C# do different than any other language? Is there any language where NaNs do not behave in the usual viral IEEE 754 way? Much that once was is lost, for none now live who remember it.
|
# ? Oct 16, 2018 22:05 |
|
ulmont posted:That Table of Contents is something...special. quote:They’re used with quiet determination, avoiding serious code. In doing this with volatile C adds a small, sullen syntax to the larger, hollow one. It makes an alloy of sorts, a counterpoint.
|
# ? Oct 17, 2018 00:02 |
|
Yeah, JF is very pleased with himself about that paper, and I can’t quite bear to break it to him that it’s really just annoying.
|
# ? Oct 17, 2018 02:05 |
|
rjmccall posted:Yeah, JF is very pleased with himself about that paper, and I can’t quite bear to break it to him that it’s really just annoying. Sometimes a little goes a long way. I'd be funnier and more effective to dial it back a bit.
|
# ? Oct 17, 2018 02:09 |
|
Ok I’m glad I wasn’t the only one doing the internet-reading-equivalent of a nervous chuckle as I locate the nearest exit.
|
# ? Oct 17, 2018 02:12 |
|
I know exactly one human who both uses volatile and has read the Kingkiller series. He even tolerates C++ far more than I do, if there's anyone on the planet who can appreciate it I'll know tomorrow.
|
# ? Oct 17, 2018 02:24 |
|
I agree with the proposal, in principle (haven't read it in detail because #yolo). There's a lot about the current incarnation of volatile that plain doesn't make sense, and even gives dangerous, wrong ideas to programmers (like that incrementing volatiles is atomic). And, as I mentioned, I have written generic code that overloads on both const and volatile (and both lvalue and rvalue references) and "pain in the rear end" is an understatement
hackbunny fucked around with this message at 02:47 on Oct 17, 2018 |
# ? Oct 17, 2018 02:44 |
|
So, part of the problem with overloading by qualification is that the language only actually acknowledges two qualifiers when basically every compiler adds several more: restrict, address spaces, and dialect-specific features like the ObjC ARC ownership qualifiers, not to mention a bunch of type attributes that aren’t quite qualifiers like calling conventions. Some features in C++, like fully-opaque templating, naturally support this complexity because they only test whether a particular expression syntax works. Unfortunately, other features like structural template argument deduction and non-static member function qualification run into a big brick wall because they rely on at least partially destructuring a type, so unless you include a case for every combination of extended qualifiers in your language, they basically can’t be combined with these language extensions. So my concern with this proposal is that it’s in part trying to address a deeper problem — C++ is bad at handling some kinds of polymorphism — by defining it away for volatile so that it’s just about const, when actually it can’t be defined away like that if you take the extensions seriously.
|
# ? Oct 17, 2018 03:57 |
|
You people and your fancy languages complaining about NANs. In shader code, we just add 0.00001f to any division that may result in a divide by zero and hope for the best because the alternative is usually too expensive.
|
# ? Oct 17, 2018 11:36 |
|
rjmccall posted:So, part of the problem with overloading by qualification is that the language only actually acknowledges two qualifiers when basically every compiler adds several more: restrict, address spaces, and dialect-specific features like the ObjC ARC ownership qualifier __unaligned! rjmccall posted:So my concern with this proposal is that it’s in part trying to address a deeper problem — C++ is bad at handling some kinds of polymorphism — by defining it away for volatile so that it’s just about const, when actually it can’t be defined away like that if you take the extensions seriously. It should probably be split into two different proposals, one for restricting the kinds of operations that are legal on a volatile and/or the kind of objects that can be qualified volatile, one for addressing qualifier explosion in generic code
|
# ? Oct 17, 2018 12:35 |
|
Falcorum posted:You people and your fancy languages complaining about NANs. In shader code, we just add 0.00001f to any division that may result in a divide by zero and hope for the best because the alternative is usually too expensive. Look at this sucker, dividing in shader code. I get most of my NaNs from incomplete texture attachments.
|
# ? Oct 17, 2018 13:58 |
|
Incomplete texture attachments crash things nowadays (sometimes )! Does the entirety of Scaleform count as a coding horror? Its batching is so terrible that nearly 1/3rd of the GPU frametime is rendering scaleform UI elements. (and don't get me started on the CPU usage, that thing allocates more garbage in a single frame than the rest of the game does in like 10 seconds)
|
# ? Oct 21, 2018 12:49 |
|
Um. Is this serious or are they trolling? https://sqlite.org/codeofconduct.html
|
# ? Oct 22, 2018 20:48 |
|
Both.
|
# ? Oct 22, 2018 20:55 |
|
Well that’s disappointing. Though I can’t say I’m shocked that SQLite went down the idiosyncratic route.
|
# ? Oct 22, 2018 22:13 |
|
pokeyman posted:Well that’s disappointing. I wouldn't be surprised for this to be the answer to some idiot coming and asking for a code of conduct (as they are known to do) and then making a fuss when they're told to take a hike. Have one, that will shut them up. Make it ridiculous, have a good laugh about it. Then just go on your merry way and not worry about it.
|
# ? Oct 22, 2018 22:20 |
|
Volguus posted:some idiot coming and asking for a code of conduct (as they are known to do)
|
# ? Oct 22, 2018 22:21 |
|
Nope, turns out it's completely real. The main SQLite creator is a very religious guy and is completely serious about this. You can go look up his website and the posts on the SQLite mailing list if you want proof.
|
# ? Oct 22, 2018 22:25 |
|
JawnV6 posted:I know exactly one human who both uses volatile and has read the Kingkiller series. He even tolerates C++ far more than I do, if there's anyone on the planet who can appreciate it I'll know tomorrow. Oh, right, I learned something: Herb Sutter is also a fan of the Kingkiller series, and was on the review for this. So the cringe-inducing parts were for someone. tbh I never considered some of the corner cases around incrementing, in the i-dont-care-if-this-tears variety, but still think there should be some way to specify "please spin on this BS operation that you know is BS for Reasons"
|
# ? Oct 22, 2018 22:28 |
|
|
# ? May 20, 2024 23:58 |
|
Carbon dioxide posted:Nope, turns out it's completely real. The main SQLite creator is a very religious guy and is completely serious about this. You can go look up his website and the posts on the SQLite mailing list if you want proof. Well, well, well. He is serious. Would have never thought. Well, good luck to him then. SQLite still is a very good project and until it ceases to be so I'll still use it.
|
# ? Oct 22, 2018 22:31 |