News for hackers. Stuff that matters.
Re:New features coming in Julia 1.7 by qsort on Tuesday October 05, 2021 @08:14AM (#28758338)
It might be because my background is CS and not hard science, but non-ASCII variable names are one of the most baffling decisions I have ever seen in any programming language.

Whatever reading comprehension advantage they may carry is completely negated by the fact that they can't be typed from a regular keyboard.

I hear it's gaining traction, though, so it's likely many of the problems you mention will be fixed or mitigated, eventually.

Re:New features coming in Julia 1.7 by sannee on Tuesday October 05, 2021 @08:25AM (#28758416)
Supporting the LaTeX expansion is just a necessary feature of any Julia-compatible code editor. It is not then particularly more difficult to type `\sigma` over `sigma`.

Also note that other languages often support non-ASCII identifiers as well --- for example, `σ` is a completely valid identifier name in Python (though it is more restrictive than Julia, `σ²` is not valid in Python and yet is valid in Julia). It even works in C, but that might just be a GNU extension.

Re:New features coming in Julia 1.7 by jstx1 on Tuesday October 05, 2021 @09:14AM (#28758943)
It's not just identifiers though, it's also operators. To take an example from the OP article, I can't relate to anyone who claims that ∛x is better than cbrt(x). The fact that this is not only allowed but actively encouraged is absolutely baffling to me.
Re:New features coming in Julia 1.7 by find on Tuesday October 05, 2021 @09:41AM (#28759339)
The language of science is mathematics, so code that more closely resembles mathematical notation can be more efficient for practicing scientists to understand. There's a lot of value in code that looks like the expression published in the paper, because when another scientist wants to build upon or modify that code, they'll read and understand the paper first, not the package code.

Also in physics, sometimes you get really large expressions with a lot of Greek letters and operators. In the paper, you make it a double-wide multiline equation with LaTeX. It makes a big difference if that corresponds to a few lines of Greek symbols in your code, and not twenty.

Re:New features coming in Julia 1.7 by shakow on Tuesday October 05, 2021 @09:47AM (#28759419)
> I can't relate to anyone who claims that ∛x is better than cbrt(x)

I do. It's a simple \cbrt<tab> away in any editor worth their salt, and it greatly improves readability of computation-heavy code – ∛(ϵ² + ξ³) ≤ Φ(π) is much clearer than the ASCII equivalent.

Re:New features coming in Julia 1.7 by maccam912 on Tuesday October 05, 2021 @09:29AM (#28759168)
Eh, I have to diagree on that. A mathematician reading ∛x in code will immediately know what it means, but that isn't necessarily true when seeing cbrt(x). Julia was written for mathematicians, not programmers, and takes some getting used to.
Re:New features coming in Julia 1.7 by jstx1 on Tuesday October 05, 2021 @09:48AM (#28759430)
The mathematician still has to type \cbrt + tab to type the glyph so they have to know the name of the function. Not only that, they have to know the name of the function from reading the Unicode glyph or be constantly pasting characters into the REPL. I don't get how that's more efficient in any way.
Re:New features coming in Julia 1.7 by leephillips on Tuesday October 05, 2021 @10:15AM (#28759770)
We are in the age of Unicode. The LaTeX entry methods are options, not required. I rarely use them, and don’t paste in characters. I hit a modifier key. Typing a Greek letter is no more inconvenient than typing an uppercase letter.
Re:New features coming in Julia 1.7 by hyperjeff on Tuesday October 05, 2021 @03:04PM (#28764060)
> Whatever reading comprehension advantage they may carry is completely negated by the fact that they can't be typed from a regular keyboard.

There's a curious blindspot among coders with regard to customizing their main interface with their machines. Keyboards are heavily customizable.

Some wins are extremely easy: If you want instant access to all Greek letters on a Mac (e.g.), you can have your caps lock key toggle between your standard layout and the Greek layout. (no \alpha, just α.) The rabbit hole runs deep from there if you are adventurous. Look at all the option key symbols you don't use. Swap them out for nice things like real arrows, ∈, and whatever you fancy.

Maybe you have restraints or biases about work code being all ASCII, but typeability is up to you.

Re:New features coming in Julia 1.7 by leephillips on Tuesday October 05, 2021 @03:56PM (#28764767)
Absolutely. On Linux it’s as simple as defining a “dead Greek” key, and you have access to the whole Greek alphabet. When I hear people complaining about the terrible burden that Julia allows Greek letters, to me it sounds like someone complaining that it allows uppercase letters. Same thing: one modifier key.
Re:New features coming in Julia 1.7 by qsort on Tuesday October 05, 2021 @03:56PM (#28764755)
Customization is a double edged sword though. A keyboard is simple and universal, and it's always the same, my skills transfer between machines, operating systems, languages, software, etc.

Yes, it's just muscle memory and you can always re-train it, but there's very little return for my investment.

> Maybe you have restraints or biases about work code being all ASCII

I'm heavily biased towards all-ASCII for everything except explicitly multilingual contexts (UIs, display formats, browsers, document editing, etc.). As far as I'm concerned, any byte set to any value above 127 in any source file should be a compile-time error. A few reasons why:

- It's basically guaranteed something somewhere will screw up the encoding. ASCII is the safest subset.

- Better ability to quickly, reliably input characters across machines and tech stacks.

- Easy to memorize. Characters are easily and immediately recognizable by everyone worldwide.

- Some fonts might lack support for some non-ASCII characters.

- Many non-ASCII characters are just plain unreadable. On my screen, lowercase alpha looks like a lowercase latin "A".

I can see an argument for allowing non-ASCII characters inside string literals and comments, but with non-ASCII identifiers you're just looking for trouble.

Re:New features coming in Julia 1.7 by hyperjeff on Tuesday October 05, 2021 @04:58PM (#28765536)
> Yes, it's just muscle memory and you can always re-train it, but there's very little return for my investment.

As a data point of one, I've found the return to be enormous and the investment suprisingly small. You have a whole lifetime of typing ahead, so what's a small investment of time compared to that? Just something to consider.

> As far as I'm concerned, any byte set to any value above 127 in any source file should be a compile-time error.

People can vote by using the languages and tools they want, but I have been waiting for that limitation to die for quite some time. I also use function names longer than 6 characters. That said, I realize I'm lucky enough to be in charge of my own programming environments and don't have to worry about its adoption in unknown limited scenarios.

> I can see an argument for allowing non-ASCII characters inside string literals and comments, but with non-ASCII identifiers you're just looking for trouble.

Again, just as a data point, I've never found this to be an issue (if one is prudent and not obnoxious with it), though the language support needs to be in place. In my main language these days, Swift, it's fine. Julia and Kotlin too.

Re:New features coming in Julia 1.7 by huijzer on Tuesday October 05, 2021 @12:48PM (#28761979)
> Whatever reading comprehension advantage they may carry is completely negated by the fact that they can't be typed from a regular keyboard.

I also am not really a fan in many cases, but in the case of Bayesian models it makes so much more sense to write "σ" than "sigma". In the case of these complex models, being able to stay closer to the math reduces complexity for the reader. Also, you don't have to use Unicode in your own Julia codebase. It's more of an extra feature which you can use if you want.

Re:New features coming in Julia 1.7 by dunefox on Tuesday October 05, 2021 @11:25AM (#28760721)
They can very easily be typed from a regular keyboard, I'm doing it every day. \alpha<TAB>. Also, it's much more readable than typing the characters out like alpha_ij.