Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The 'if' construct (or equivalently, conditional jump) is inherently tied to binary. On a ternary computer, the natural conditional would have three branches, not two.


In some ways this seems like it might be very useful. I can easily see an if-statement with true/false/error cases, or less-than/equal-to/greater-than cases.


What percentage of real-world if cases would benefit from it, in the sense that the three branches are actually different. I would say it's a small number. Yes, there are range checks which could benefit, but more often than not, the two extreme ranges are treated the same, as an error condition.

My guess is that most hot conditional jumps are loop returns. That's certainly binary.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: