OT: Leaving Rust gamedev after 3 years

Bruce Carneal bcarneal at gmail.com
Mon Apr 29 21:01:46 UTC 2024


On Monday, 29 April 2024 at 20:01:18 UTC, monkyyy wrote:
> On Monday, 29 April 2024 at 18:53:24 UTC, bachmeier wrote:
>>
>> A computer program should produce the correct answer every 
>> time it runs.
>
> not in videogames and rendering; the goal is often make pretty 
> colors; bugs are often features

If you're fine with bugs I imagine you'd be in the zero-init 
camp.  Not much point to NaN as a debug aide if FP correctness is 
defined loosely enough.

>
>>> 0 is correct for sum, 1 is correct for products, random 
>>> numbers are even ok; yes so there tradeoffs between any of 
>>> these; but nan is a black hole specifically designed to break 
>>> everything
>>
>> It's no more of a black hole than 0 or 1.
>
> snip...
>
> then there are black holes of 0 where either int went extinct/0
>
> nan is a black hole for basically every primitive function (by 
> design) and therefor as I pull dynamic systems out of my ass 
> and hope they make nice animations or systems or pretty colors, 
> nan is basically *always* a black hole unless I specifically 
> designed each and every pathway to avoid it in a way 0 or 1 
> never are, 0 is only a black hole for multiplication and its an 
> identity for adds, so its not even comparable

I agree, they are not comparable.  NaN was designed to be a 
universal "something went wrong" return value, a sticky one.  If 
you don't need/want that then you're probably a zero-init 
devotee.  If you do want it, to represent general failure as well 
as failure to init, then you're gonna want NaN init.  A single, 
reliable, automatic, unambiguous, "black hole".




More information about the Digitalmars-d mailing list