Ancestors

Written by Mark Gritter on 2025-01-11 at 05:44

A #ComputingHistory question that came up today: what is the origin of | (the vertical stroke) as bitwise OR in PL/I, and thence to the C family of languages?

I haven't been able to trace it further back, and interestingly in logic it was the "Sheffer Stroke", NAND (although Wikipedia claims that Sheffer actually used it for NOR instead?) There does not seem to be a logic or typesetting convention that birthed |.

I don't know enough about early IBM keyboards to know what other characters might be available.

The choice of & for AND instead of ^ -- it's right there! -- is similarly unclear.

=> More informations about this toot | More toots from markgritter@mathstodon.xyz

Written by rk: could be an enum on 2025-01-11 at 06:08

@markgritter

I’m willing to bet & was chosen because ^ was unavailable in some common character set or configuration and would be mnemonic for “and” but for | meaning or…

Well shit now I’m nerdsniped. I was wondering if maybe it went back to Kleene with his original regex paper, but I just checked and it’s / there.

What’s interesting is that in Thompson’s regex paper, he uses | to mean or and doesn’t explain it, assuming the reader is already familiar.

=> More informations about this toot | More toots from rk@well.com

Written by rk: could be an enum on 2025-01-11 at 06:10

@markgritter

I don’t think it’s from the Sheffer stroke; NAND doesn’t seem to immediately lend itself to OR.

It’s prolly gonna be something like “we ran out of characters for operators” or something.

At least the APL keyboards had the proper symbols for everything, as God intended.

=> More informations about this toot | More toots from rk@well.com

Toot

Written by Mark Gritter on 2025-01-11 at 06:27

@rk I found a "PL/I for people who know Fortran" doc which introduces all the new special characters not in Fortran. I didn't realize PL/I used || for concatenation!

From http://www.bitsavers.org/pdf/ibm/360/pli/SC20-1637-3_A_Guide_to_PL_I_for_FORTRAN_Users_May68.pdf

There's gotta be an IBM keyboard to find that has |, &, and ¬ but lacks ^.

=> View attached media | View attached media

=> More informations about this toot | More toots from markgritter@mathstodon.xyz

Descendants

Written by Mark Gritter on 2025-01-11 at 06:31

@rk Like maybe the 1052?

https://sharktastica.co.uk/resources/images/typewriters/ComputerGeek7066_1052.jpg

This looks like about the right set of characters for PL/I, and has no ^ but it does have ¬.

=> View attached media

=> More informations about this toot | More toots from markgritter@mathstodon.xyz

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113808299576511338
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
401.972069 milliseconds
Gemini-to-HTML Time
0.867121 milliseconds

This content has been proxied by September (3851b).