# The Hegemony Of \`==\` Must End; Welcome The \`⩵\` Upstart

**URL:** https://discourse.julialang.org/t/the-hegemony-of-must-end-welcome-the-upstart/63605
**Category:** Offtopic
**Tags:** syntax
**Created:** [June 26, 2021, 2:40pm UTC](https://discourse.julialang.org/t/the-hegemony-of-must-end-welcome-the-upstart/63605 "2021-06-26T14:40:57Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)
#### Post date: [June 28, 2021, 5:20pm UTC](https://discourse.julialang.org/t/the-hegemony-of-must-end-welcome-the-upstart/63605/21 "2021-06-28T17:20:16Z")

</div>

This is basically just font ligatures, and is a feature of the font itself, and doesn’t need to have anything to do with the programming language.

See e.g. [Hasklig](https://github.com/i-tu/Hasklig), [Fira Code](https://github.com/tonsky/FiraCode) and [JuliaMono](https://juliamono.netlify.app/).

So this is already available for Julia, and any other language, for that matter.

---

<div class="post-metadata">

### Author: ![blackeneth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/blackeneth/32/10353_2.png) [@blackeneth](https://discourse.julialang.org/u/blackeneth)
#### Post date: [June 28, 2021, 5:59pm UTC](https://discourse.julialang.org/t/the-hegemony-of-must-end-welcome-the-upstart/63605/22 "2021-06-28T17:59:15Z")

</div>

because your right pinky never presses =.  
Instead, you type \ie[tab] and ⩵ is inserted.

---

<div class="post-metadata">

### Author: ![jessymilare](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jessymilare/32/13750_2.png) [@jessymilare](https://discourse.julialang.org/u/jessymilare)
#### Post date: [June 28, 2021, 6:06pm UTC](https://discourse.julialang.org/t/the-hegemony-of-must-end-welcome-the-upstart/63605/23 "2021-06-28T18:06:15Z")

</div>

> [@blackeneth](#):
>
> **Objection:** You can do it yourself
> 
> @jzr
> 
> ```julia
> julia> a ≟ b = a == b
> ≟ (generic function with 1 method)
> julia> 4 ≟ 4
> true
> 
> ```
> 
> I replied: that makes you the only creepy dude in the world who does it, and you get puzzled questions from library maintainers.

This response is terrible.

First, you cannot force other people to like what you like. Even if this new syntax was accepted into Julia source code, most library maintainers would still not accept PRs with unicode (i.e. non-ASCII) characters.

Second, if you are the only one in the world who uses a different syntax, that DOES NOT make you creepy. Today is Pride Day, the best day to remember that being different is not creepy, not weird nor sinful. It is also the day to remember that people have different tastes and opinions. Diversity is a good thing.

In short, if you want to use a different syntax, use it. The option is already on the table. If other people adopt it, that’s great, otherwise, that’s okay, too.

---

<div class="post-metadata">

### Author: ![apo383](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/apo383/32/11272_2.png) [@apo383](https://discourse.julialang.org/u/apo383)
#### Post date: [June 28, 2021, 6:20pm UTC](https://discourse.julialang.org/t/the-hegemony-of-must-end-welcome-the-upstart/63605/24 "2021-06-28T18:20:35Z")

</div>

> [@DNF](#):
>
> This is basically just font ligatures

Sure, but suggestion was to treat the ligature as alias: `⩵` and `==`, which is not currently the case (I’ll edit my post to clarify). It’s great that the ligature(s) are available in multiple fonts, so why not build them in? (As others have noted, this could/should be implemented in a package, which would make it convenient to test out.)

---

<div class="post-metadata">

### Author: ![blackeneth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/blackeneth/32/10353_2.png) [@blackeneth](https://discourse.julialang.org/u/blackeneth)
#### Post date: [June 28, 2021, 6:27pm UTC](https://discourse.julialang.org/t/the-hegemony-of-must-end-welcome-the-upstart/63605/25 "2021-06-28T18:27:43Z")

</div>

I **like** this idea. It meets the requirement.

The documentation for [custom keybindings](https://docs.julialang.org/en/v1/stdlib/REPL/#Customizing-keybindings)

The documentation says to \* Users should refer to `LineEdit.jl` to discover the available actions on key input.\*

This file can be found in julia/share/stdlib/v1.6/REPL/src

LineEdit.jl is a 2563 line program written by someone obviously very skilled in writing a character interface.

The “available actions” appear to start at line 238. “:edit\_insert” looks promising. Search for “edit\_insert” and you find the function edit\_insert() at line 736.

At that point, function edit\_insert() is incomprehensible to me.

So, let’s try guessing (if you consider this to be a bad method, you would be correct):

_This does not work:_

```julia
import REPL
import REPL.LineEdit

const mykeys = Dict{Any,Any}(
    # \ie[tab] to ==
    "\\ie" => (s,o...)->(LineEdit.edit_insert, s, "==") 
)

function customize_keys(repl)
    repl.interface = REPL.setup_interface(repl; extra_repl_keymap = mykeys)
end

atreplinit(customize_keys)

```

In fact, executing the above in your startup.jl will prevent you from typing the letter “e”.  
You can’t type exit() to get out.

It took me about two hours to come up with that guess (it is in fact guess version 4, the first three were worse).

---

<div class="post-metadata">

### Author: ![blackeneth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/blackeneth/32/10353_2.png) [@blackeneth](https://discourse.julialang.org/u/blackeneth)
#### Post date: [June 28, 2021, 6:50pm UTC](https://discourse.julialang.org/t/the-hegemony-of-must-end-welcome-the-upstart/63605/26 "2021-06-28T18:50:22Z")

</div>

> If after a while you get a bunch of users, revive this topic: you will be in a much better position to argue for it.

That’s just erecting a _marketing_ barrier to the proposal. Say I create a “package” (consisting of one line of code). Users may love it, but if they don’t know about it, they can’t benefit from it. Package popularly then depends on how well it is marketed to the user base, not on how much user benefit comes from it.

Package popularity is also not always indicative of a change you would want to make. Say I marketed the _brilliant_ [TwoBasedIndexing](https://github.com/simonster/TwoBasedIndexing.jl) package and got 10,000 users to implement and use it. Would that convince you to finally implement two-based indexing into Julia and replace “obsolete one-based indexing to proper two-based indexing”?

---

<div class="post-metadata">

### Author: ![lostella](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lostella/32/356_2.png) [@lostella](https://discourse.julialang.org/u/lostella)
#### Post date: [June 28, 2021, 6:56pm UTC](https://discourse.julialang.org/t/the-hegemony-of-must-end-welcome-the-upstart/63605/27 "2021-06-28T18:56:19Z")

</div>

> [@blackeneth](#):
>
> because your right pinky never presses =

But your brain does 😉

---

<div class="post-metadata">

### Author: ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)
#### Post date: [June 28, 2021, 7:16pm UTC](https://discourse.julialang.org/t/the-hegemony-of-must-end-welcome-the-upstart/63605/28 "2021-06-28T19:16:44Z")

</div>

> [@apo383](#):
>
> Sure, but suggestion was to treat the ligature as alias: `⩵` and `==` , which is not currently the case

I think we are talking past each other. The programming language has nothing to do with this, and you don’t have to ‘treat’ anything as an alias, because it’s just one ‘thing’.

When a font supports ligatures it means that it just displays a character combination in a certain way, without changing the underlying representation. There’s no need for a Julia package, it’s handled entirely by the font itself, plus the editor, which needs to support it, and this is not the case for the REPL – is that what you are referring to?

I mean, this already exists and works for VS Code and Sublime Text, at least, probably more. The fonts just need to introduce a ligature for `==`. Julia doesn’t need to do anything at all.

Update: It seems that Fira Code, does already, but not JuliaMono. I’m not sure if this is distinctive enough, though:  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/b/0/b0bf5bc661d0d875ec33ce588ad9e2da5586bec1.png)

---

<div class="post-metadata">

### Author: ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)
#### Post date: [June 28, 2021, 7:30pm UTC](https://discourse.julialang.org/t/the-hegemony-of-must-end-welcome-the-upstart/63605/29 "2021-06-28T19:30:42Z")

</div>

> [@blackeneth](#):
>
> I **like** this idea. It meets the requirement.

Great.

I would suggest opening a separate topic on the specific question of how to implement a new tab-completion for your editor/repl.

---

<div class="post-metadata">

### Author: ![blackeneth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/blackeneth/32/10353_2.png) [@blackeneth](https://discourse.julialang.org/u/blackeneth)
#### Post date: [June 28, 2021, 7:45pm UTC](https://discourse.julialang.org/t/the-hegemony-of-must-end-welcome-the-upstart/63605/30 "2021-06-28T19:45:25Z")

</div>

```julia
julia> isequal(NaN, NaN*5)
true

julia> NaN==NaN*5
false

```

Let’s try it with missing

```julia
julia> isequal(missing,missing)
true

julia> missing==missing
missing

```

That last one is a little surprising (although consistent with documentation)

---

<div class="post-metadata">

### Author: ![apo383](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/apo383/32/11272_2.png) [@apo383](https://discourse.julialang.org/u/apo383)
#### Post date: [June 28, 2021, 9:25pm UTC](https://discourse.julialang.org/t/the-hegemony-of-must-end-welcome-the-upstart/63605/31 "2021-06-28T21:25:42Z")

</div>

Ah, thanks for the explanation. I was in Monaco font in terminal REPL. I’ve installed Fira Code (and “Use ligatures” in iTerm2) and can verify that it does do the ligature properly, and still treats (e.g. copies) it as two equals chars `==`.

The ligature is a neat editor feature, but I think it is still different from REPL. With ligatures turned off, I can type `\ge` to get `≥` which I believe to be an alias for `>=`, that also looks distinctly different from the Fira Code ligature. For consistency, I’d be in favor of REPL treating `\Equal` as alias for `==`. The issue isn’t the input, it’s the treatment.

Not that anybody cares, but Mathematica does it a slightly different way, because you type two characters `->` and copy just one `→`.

---

<div class="post-metadata">

### Author: ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)
#### Post date: [June 28, 2021, 9:35pm UTC](https://discourse.julialang.org/t/the-hegemony-of-must-end-welcome-the-upstart/63605/32 "2021-06-28T21:35:47Z")

</div>

> [@apo383](#):
>
> but Mathematica does it a slightly different way

but people don’t write Mathematica over ssh on `vi`, you can do whatever you want, Julia has support for you:

```julia
julia> const ⩵ = ==

```

or you can open a PR to add this alias, or just use a font with ligatures. It’s all up to you, but please don’t open two thousands PR later to add this and change every `==` to `⩵` across all julia rpeo (semi-jokingly

---

<div class="post-metadata">

### Author: ![D\_A](https://avatars.discourse-cdn.com/v4/letter/d/8dc957/32.png) [@D\_A](https://discourse.julialang.org/u/D_A)
#### Post date: [June 28, 2021, 9:35pm UTC](https://discourse.julialang.org/t/the-hegemony-of-must-end-welcome-the-upstart/63605/33 "2021-06-28T21:35:54Z")

</div>

About ligatures and Julia Mono, I recently opened an [“issue”](https://github.com/cormullion/juliamono/issues/111) about it, if some of you are interested.

---

<div class="post-metadata">

### Author: ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)
#### Post date: [June 28, 2021, 9:36pm UTC](https://discourse.julialang.org/t/the-hegemony-of-must-end-welcome-the-upstart/63605/34 "2021-06-28T21:36:56Z")

</div>

> [@apo383](#):
>
> With ligatures turned off, I can type `\ge` to get `≥` which I believe to be an alias for `>=`

Yes, `≥` is a unicode character which is separate from `>=`, while the font ligatures are just a display effect, and keeps the underlying characters unchanged, so when someone else looks at my code, they cannot tell if I have used ligatures or not.

Whether or not `≥` is an alias for `>=` is entirely up to Julia, while font ligatures are completely not.

---

<div class="post-metadata">

### Author: ![Per](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/per/32/10387_2.png) [@Per](https://discourse.julialang.org/u/Per)
#### Post date: [June 30, 2021, 10:14am UTC](https://discourse.julialang.org/t/the-hegemony-of-must-end-welcome-the-upstart/63605/35 "2021-06-30T10:14:19Z")

</div>

I think that `⩵` should be an alias for `==`, not for the reasons mentioned above, but simply because it would discourage people from making it an alias for something else.

---

<div class="post-metadata">

### Author: ![skypuppy](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@skypuppy](https://discourse.julialang.org/u/skypuppy)
#### Post date: [June 30, 2021, 10:36am UTC](https://discourse.julialang.org/t/the-hegemony-of-must-end-welcome-the-upstart/63605/36 "2021-06-30T10:36:06Z")

</div>

If it really becomes a Big Deal, please allow BOTH syntaxes to be ==. And no one will have to change their code.

---

<div class="post-metadata">

### Author: ![sijo](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sijo](https://discourse.julialang.org/u/sijo)
#### Post date: [June 30, 2021, 12:28pm UTC](https://discourse.julialang.org/t/the-hegemony-of-must-end-welcome-the-upstart/63605/37 "2021-06-30T12:28:58Z")

</div>

> [@blackeneth](#):
>
> This does not work:
> 
> [Code to add \ie as REPL completion…]

You can find the completion engine in `stdlib/REPL/src/REPLCompletions.jl`. Currently it assumes that completions starting with a `\` character are either LaTeX or (if starting with `\:`) emojis. So a proper implementation would require a refactoring, but for a quick test you can add a “LaTeX” completion:

```julia
Base.REPL_MODULE_REF[].REPLCompletions.latex_symbols["\\ie"] = "=="

```

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [June 30, 2021, 1:44pm UTC](https://discourse.julialang.org/t/the-hegemony-of-must-end-welcome-the-upstart/63605/38 "2021-06-30T13:44:33Z")

</div>

> [@Per](#):
>
> it would discourage people from making it an alias for something else

```julia
function ⩵(args...)
    @warn "you think you need this, but you don't, really"
    exit(666)
end

```

could also work for that purpose.

---

<div class="post-metadata">

### Author: ![D\_A](https://avatars.discourse-cdn.com/v4/letter/d/8dc957/32.png) [@D\_A](https://discourse.julialang.org/u/D_A)
#### Post date: [July 3, 2021, 8:06pm UTC](https://discourse.julialang.org/t/the-hegemony-of-must-end-welcome-the-upstart/63605/39 "2021-07-03T20:06:38Z")

</div>

Some say this would be a breaking change since some modules might already be using `⩵` for other purposes, but couldn’t this problem be solved (and thus have a whole consistent group of single-character Unicode operators) by temporarily adding a warning when this symbol is currently used not as an alias for `==`? Same for `⩶`, while we’re at it!

---

<div class="post-metadata">

### Author: ![ParadaCarleton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paradacarleton/32/20005_2.png) [@ParadaCarleton](https://discourse.julialang.org/u/ParadaCarleton)
#### Post date: [July 4, 2021, 3:32pm UTC](https://discourse.julialang.org/t/the-hegemony-of-must-end-welcome-the-upstart/63605/40 "2021-07-04T15:32:30Z")

</div>

> **Objection:** It’s just one of many common errors  
> @oheil replied:  
> There are a lot of common errors. E.g. forgetting `;` at the end of a line, forgetting a closing `"` at the end of a string, using `'` instead of `"` for strings, just to name a few which come to mind for this and other languages.
> 
> **Response:** Not quite the same.

That’s not really the argument I would make. I think it’s _exactly_ the same – and fixing common mistakes like thesse is a good idea. Julia has _already_ fixed the problem of `;` by assuming a new line of code is, well, a new line. This despite adding semicolons not being that difficult; sure, but why make it harder? (`'` vs `"` has a useful role – a single character is different from a string, and in a typed language like Julia this can be a useful distinction from time to time. On the other hand, there’s nothing useful that `=?` or `≟` are doing at the moment – there’s no cost to aliasing them to `isequal`, and they’d clearly be popular among at least a handful of programmers.)

[Previous page](https://discourse.julialang.org/t/the-hegemony-of-must-end-welcome-the-upstart/63605.md?page=1)

[Next page](https://discourse.julialang.org/t/the-hegemony-of-must-end-welcome-the-upstart/63605.md?page=3)
