tlaplus / tlaplus-standard

A collection of various standards, proposed or established, related to TLA+
MIT License
5 stars 1 forks source link

Alternatives to diamond operator? #5

Closed ahelwer closed 11 months ago

ahelwer commented 1 year ago

The current diamond operator shows up quite small in some cases (VS Code in macOS, see https://github.com/tlaplus-community/tlauc/issues/4). Currently we use:

⋄ Diamond Operator (U+22C4) Mathematical Operators Block

Here are some alternatives:

The diamond operator (current standard) is semantically the most appropriate, as it is included in the mathematical operators block. The specific font used in VS Code in macOS certainly displays it weirdly (some would say incorrectly). The White Diamond symbol of the Geometric Shapes Block is probably the most appropriate alternative. Note the [] operator is currently □ White Square (U+25A1) Geometric Shapes Block (no equivalent exists in the Mathematical Symbols Block weirdly) so this is not without precedent.

ahelwer commented 1 year ago
---- MODULE Test ----
CurrentDiamondOperator == □⋄P
NewWhiteDiamond == □◇P
TestHandleParseError == 1 + 2 + 3
====

Here's a test of how the operator looks. Since the diamond operator is often used next to the box operator, it actually makes sense that they would be drawn from the same unicode block. I think the proposed new white diamond operator looks quite a bit nicer. The TLA+ tree-sitter grammar highlighting used by github fails to highlight it right now of course (since it's invalid syntax), but it seems to recover from the parse error fairly well. I propose changing the diamond operator to ◇ White Diamond (U+25C7) Geometric Shapes Block. Work necessary:

ahelwer commented 11 months ago

Github highlighting was updated so all tasks have been completed.

lemmy commented 7 months ago

Related, the action composition operator \cdot is tiny on macOS:

image
ahelwer commented 7 months ago

Yeah this one is difficult because there are four different circle operators that all need to look different:

Maybe could switch \cdot and \bullet or something but idk. There isn't a lot of visual variation available for circles other than size! I don't even think filled in vs. not will be standardized across fonts.