tonsky / FiraCode

Free monospaced font with programming ligatures
SIL Open Font License 1.1
76.09k stars 3.07k forks source link

[Raku] General support and set theory operators #1428

Open habere-et-dispertire opened 2 years ago

habere-et-dispertire commented 2 years ago

FiraCode supports Set Logic and so does Raku! Of the many operators raku has, I'm missing the set theory ones:

ASCII Unicode
(&)      ∩
(|)      ∪
(<)      ⊂
(>)      ⊃
(<=)     ⊆
(==)     ≡
(>=)     ⊇
(^)      ⊖

(cont)   ∋
(elem)   ∈

Can FiraCode remove the surrounding parentheses and give us its Set Logic glyphs?

Many thanks!

tonsky commented 2 years ago

Maybe only as a stylistic set?

habere-et-dispertire commented 2 years ago

The raku ASCII equivalents are a relatively new construction compared to the standard mathematical representations — so I lean towards dropping the parentheses for the more recognized form as they are intended to mimic the mathematical form within the limitations of the raku grammar.

I appreciate the somewhat larger size of the FiraCode operators, and hope that the set logic operators can be on a similar scale. The Unicode equivalents often appear too small. See below:

is-achilles-min

Here the less than or equals to sign ≤ is a Unicode glyph and of a different size compared to the equality operator beneath it (which is in ASCII and a double equals sign in the source).

Contrast this with using only the ASCII equivalents for both which look uniform and is additionally centred (<= and == in the source):

set-logic-min

This is what I hope FiraCode can bring to the Set Logic operators: a uniform larger size, the centering and the meeting of the mathematical intent behind raku's ASCII approximation by the default dropping of these parentheses.

habere-et-dispertire commented 2 years ago

Raku intentionally has a lot ... of operators. Is each programming language going to have a stylistic set?

I found two other raku operators with ASCII equivalents that visually mimic their Unicode counterpart but which are missing in FiraCode:

habere-et-dispertire commented 2 years ago

In raku, < and > are used together as delimiters, called quote words. For example, an array of the addition and subtraction operators could look like:

my @operators = &infix:<+>, &infix:<->

The problem here is that <-> is interpreted by FiraCode as a left-right arrow.

habere-et-dispertire commented 2 years ago

Bumped into another one, the numeric comparison operator <=> which is somewhat confusing to see rendered as a double left-right arrow.

habere-et-dispertire commented 1 year ago

For an old list of ASCII operators with Unicode equivalents (the so called Texas operators) see:

https://github.com/Altai-man/p6-Texas-To-Uni/blob/master/lib/Texas/To/Uni.pm6

habere-et-dispertire commented 1 year ago

Official documentation