Warning against Unicode confusables

I apologize in advance for piling onto this but I thought I’d add a point I didn’t see earlier. I guess the usual point of these types of threads is to push the needle on the “stylistic culture” of Julia in one particular direction, so technically I see this all as productive (in some sense of the word :)).

In general I worry the popular use of unicode in Julia may be ever-so-slightly hurting Julia’s rate of adoption. While it may be supported in other languages, it is much more common in Julia including in the standard library.

I remember when I was first starting out with Julia, I looked at some ODE solver examples, and saw the use of unicode everywhere (for variable names, and some API use like \epsilon). I remember this leaving me with a poor first impression of Julia based on my naive assumptions at that time – “How can I even write Julia code in my editor if it needs unicode? I can’t just remember all the commands…” You have to keep in mind that a person encountering Julia for the first time is just going to skim some snippets and not really read deep into the complexities of the documentation and all the best tooling practices until they’ve already made the leap (if you’ve ever looked at Google analytics for a blog, it can be a bit depressing!) In my mind I only knew that ⌥+S is ß (which in retrospect is the German beta, rather than the math one…) so I got initially discouraged.

Of course it’s clear we should be setting up our tooling correctly to work with this, but I do want to point out that seeing the use of unicode for the first time in code can be a bit of a distraction to the best parts of Julia, and it might leave users with a negative impression. I think the vast majority of beginners haven’t coded in unicode before so it’s quite weird to see it the first time.

The only other language I can think of with such prevalant unicode is Lean: 100 theorems in Lean, but this makes a bit more sense to me as it is exclusively about Maths and the visual presentation of theorems, whereas Julia is a more general programming language. Thus Julia should hope to attract a more general audience as well (who might similarly recoil at the sight of unicode math).


Slightly tangential but I was trying to read through the Julia source code today in the method abstract_eval_statement_expr: julia/base/compiler/abstractinterpretation.jl at 5b6a94da5af35a4aa91759cac2f8db7669a6ec2a · JuliaLang/julia · GitHub

This has unicode which is apparently failed to render on my very modern MacBook Pro in Firefox:

I have no idea why GitHub can’t render it but stuff like this is always a bit of a negative for unicode imo.

(Not to mention I still have no idea how to write unicode math on my phone – which I will occasionally use for reviewing PRs)

10 Likes