News for hackers. Stuff that matters.
Re:Meta Releases LLM Compiler by samatman on Friday June 28, 2024 @06:50PM (#40826170)
This is one of the oldest computer operators in the game: the arithmetic IF statement from FORTRAN.

It's useful for stable-sorting collections with a single test. Also, overloading <=> for a type, gives all comparison operators "for free": ==, !=, <, <=, >=, >

Re:Meta Releases LLM Compiler by pklausler on Friday June 28, 2024 @09:51PM (#40827289)
It also has no good definition for its semantics when presented with a NaN.
Re:Meta Releases LLM Compiler by sagarm on Saturday June 29, 2024 @03:23PM (#40832810)
Re:Meta Releases LLM Compiler by pklausler on Saturday June 29, 2024 @06:28PM (#40833705)
How would that apply to Fortran’s arithmetic IF statement? It goes to one label for a negative value, or to a second label for a zero, or to a third label for positive. A NaN is in none of these categories.
Re:Meta Releases LLM Compiler by moffkalast on Saturday June 29, 2024 @06:31AM (#40829212)
I mean maybe I'm missing something but it seems like it behaves exactly the same way as subtraction? At least for integers it's definitely the same, for floats I imagine it might handle equals better?
Re:Meta Releases LLM Compiler by samatman on Saturday June 29, 2024 @01:43PM (#40832251)
C++ has operator overloading, so you can define the spaceship for any class, and get every comparison operator from the fallback definitions, which use `<=>` in some obvious ways.