Get the latest tech news

Imagining a language without booleans


Let’s start where I started. Just thinking about if statements.

If you have good mathematical intuition you might notice the asymmetry between the type rules for and and or and suspect that we’re missing some sort of generalization. No need to understand what it does (I certainly don’t remember the details), we just need to rewrite it in this hypothetical language and see how it compares. The closest thing I’ve seen is fallible expressions in Verse, but those are pretty different because they (i) don’t assign a value to an if without an else, and (ii) involve speculative execution.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of language

language

Photo of Booleans

Booleans

Related news:

News photo

RFK Jr.’s anti-vaccine panel realizes it has no idea what it’s doing, skips vote | With a lack of data and confusing language, the panel tabled the vote indefinitely.

News photo

Everything About Bitflags: How to store up to 32 booleans in one value?

News photo

Sharing Is Scaring: Linking Cloud File-Sharing to Programming Language Semantics