The case for NaN
monkyyy
crazymonkyyy at gmail.com
Thu Jul 30 16:28:02 UTC 2026
On Thursday, 30 July 2026 at 15:58:04 UTC, H. S. Teoh wrote:
> On Thu, Jul 30, 2026 at 03:20:48PM +0000, monkyyy via
> Digitalmars-d wrote:
>> On Thursday, 30 July 2026 at 07:30:54 UTC, Araq wrote:
>> > On Sunday, 5 July 2026 at 19:08:44 UTC, Walter Bright wrote:
>> > > On 7/5/2026 1:37 AM, Richard (Rikki) Andrew Cattermole
>> > > wrote:
>> > > > What we are able to do here though is throw static
>> > > > analysis at
>> > > > the problem:
>> > > > https://github.com/dlang/dmd/blob/master/changelog/dmd.fastdfa.uninitialized.dd
>> > >
>> > >
>> > > Static analysis cannot solve the problem 100%. It's the
>> > > ole' halting problem.
>> >
>> > No, it's just you not understanding the halting problem. In
>> > reality Java solved this problem since its inception. Many
>> > other languages followed since then.
>>
>> Walters correct here, you either ban things or have holes.
>>
>> Java doesnt have void*, so they havnt solved the problem for
>> the types of things youd use a void* for in c.
>>
>> Suppose I have a ubyte and a void* and a list of types for a
>> tagged reference, I use 0 to mean void itself, 1 for int etc.
>> then N+1 I use to mean slices of my sumtype and there will be
>> an int that the length of the slice at index 0. Then N+M is a
>> slice of slice of... of my sumtype, till you fill up the ubyte.
>>
>> Its valid, good luck convincing an opinionated static checker
>> to allow it.
>
> That's called a tagged union. An old, well-known idiom.
> Pretty sure static checkers can be taught to recognize it.
>
>
> T
You stopped reading 2 sentences into that paragraph:
https://www.kimi.com/share/19fb3d16-cd62-8e62-8000-0000ae040a09
You can append special cases to a formal system, I believe "this
statement is false" is tralse, so you could engineer the entire
system to allow this case algebraically solve the rules of what
every operation is, enumerate your new list of rules, have your
new compiler. "This statement is tralse", `tralse^2`? whats
`tralse^7 || tralse^3` equal to? Ops, can your new compiler keep
up?
Appending special cases does not even remotely keep up with new
expressible hostile cases in formal systems; anyone who says
otherwise still hasn't internalized the 100 year old result. Its
mountains of work to handle a slight growth in type theory in a
compiler, its a line of code to squeeze it harder.
More information about the Digitalmars-d
mailing list