Live data from Hacker News

Rust 1.53

blog.rust-lang.org

51–60 of 98 posts

Re: Rust 1.53

#51

> Identifiers can now contain non-ascii characters. All valid identifier characters in Unicode as defined in UAX #31 can now be used. That includes characters from many different scripts and languages, but does not include emoji. Don't despair fellow emoji devs, our time will come soon enough.

In the English speaking world, I have a hard time justifying untypeable identifiers. Maybe, and this is a fat maybe, Greek symbols could make the odd write-once math or scientific code easier to read. It would be bonkers to use any non-ascii codepoints in a public API.

They're hard to type if you're a Windows user. Other OSes have better input systems.

Re: Rust 1.53

#52
post #50

Earlier quoted context omitted.

Even if english speaking, it is still ambiguous. For example in my keyboard the micro sign (µ; not to be confused with the Greek small letter mu) is easy to type (AltGr + M). I bet this is the same for the majority of HN users. The US keyboard doesn’t use third level shift (usually AltGr) so most people that use US keyboard exclusively are unaware of this. Whenever I see people using the Latin small letter U (u) inst…

> For example in my keyboard the micro sign (µ; not to be confused with the Greek small letter mu) The greek letter mu IS the micro sign, where do you think it comes from?

Look the same, but different code points.

MICRO SIGN (U+00B5)[1] vs. GREEK SMALL LETTER MU (U+03BC)[2]

1: https://www.fileformat.info/info/unicode/char/00b5/index.htm

2: https://www.fileformat.info/info/unicode/char/03bc/index.htm

Re: Rust 1.53

#53

Earlier quoted context omitted.

Your statement here has so many qualifiers that it's hard to treat it as a general rule. "English speaking world" "untypeable" "public API" Even then you exempt Greek symbols. I suppose you might be willing to accept ¢ or €. Of course, "untypeable" is very ambiguous. Still, not all code is "public API" and not all code is intended for the English speaking world. So I think it's great to support non-ASCII symbols. よろし…

I was not trying to argue against its general support, only that for this English-speaking audience (HN) there are very limited use cases.

I accept your caution. But it is fun for me to consider the differences in these:

enum Size { P, XS, S, M, L, XL, XXL }

enum Size { Petit, Extra_Small, Small, Medium, Large, Extra_Large, Extra_Extra_Large }

enum Size { 小小小, 小小, 小, 中, 大, 大大, 大大大 }

Which do you prefer: P, Petit, Petite, 小小小, 3小, XXS, 2XS?

English is chalk full of non-English words. And lots of symbols are useful. Sometimes it's worth it to learn the symbol. And often not much harder than learning the English abbreviation.

enum ⏻ { ⭘, ⏽, ⏾ }

Again, "typeable" is ambiguous but obviously an important consideration.

None of this is to argue against your point. Just musing.

Re: Rust 1.53

#54

Earlier quoted context omitted.

> Maybe, and this is a fat maybe, Greek symbols could make the odd write-once math or scientific code easier to read. The Julia community has been trying really hard to convince people that this is a good idea and I'm still not on board with it.

maybe we can have some keyboard plugin/"mode" that merges letters to form symbols in special way? Korean windows have a "special-emoji" keyboard that can be invoked by: 1. type a charactor 2. press 'hanja' key 3. (wild special character selection menu appears) example: § (from 'ㅁ') / ㈜ (from 'ㅁ') / ㎖ (from 'ㄹ')

For Windows, the ENG-INTL keyboard layout is pretty good for simple accented characters, covering latin-based European languages [1].

Windows+. also allows you to just type to search for emojis, so e.g. typing WINDOWS+. sad ENTER gives you a sad emoji. Sadly this doesn't work for symbols, even though the Windows+. menu has a good coverage of symbols.

I guess you can always switch your keyboard to Korean input.

1: https://community.windows.com/en-us/stories/keyboard-shortcu...

Re: Rust 1.53

#55
post #50

Earlier quoted context omitted.

Even if english speaking, it is still ambiguous. For example in my keyboard the micro sign (µ; not to be confused with the Greek small letter mu) is easy to type (AltGr + M). I bet this is the same for the majority of HN users. The US keyboard doesn’t use third level shift (usually AltGr) so most people that use US keyboard exclusively are unaware of this. Whenever I see people using the Latin small letter U (u) inst…

> For example in my keyboard the micro sign (µ; not to be confused with the Greek small letter mu) The greek letter mu IS the micro sign, where do you think it comes from?

Unicode has both MICRO SIGN (U+00B5) and GREEK SMALL LETTER MU (U+03BC). The former is the one on (most) people's keyboard, and it shouldn't be used to type actual Greek.

Re: Rust 1.53

#56
post #7

Should one learn Rust, lets say after 3-4 years, i.e by mid 2020s, once it becomes more mainstream? The syntax of Rust is a mix of OCaml/C++ and I feel some of the concepts are very esoteric for a normal enterprise Java/C#/JS/Python developer, so it takes a lot of cognitive overload to master it. So is it worth learning now or later?

Whether you should learn it or not I can't answer, but I want to mention that I personally don't feel anything in Rust is very esoteric. Python's metaclasses or JavaScript's prototype object model feel more unusual to me than anything I encountered in Rust. If you have never written in an unmanaged language like C++ though I could see that a lot of Rust feels foreign.

Lifetimes qualify as esoteric, I think. They seem unique to Rust (please correct me if wrong) and are not immediately intuitive.

Re: Rust 1.53

#57

> Identifiers can now contain non-ascii characters. All valid identifier characters in Unicode as defined in UAX #31 can now be used. That includes characters from many different scripts and languages, but does not include emoji. Don't despair fellow emoji devs, our time will come soon enough.

Soon we'll be able to do the equivalent of the C++

  typedef shared_ptr Foo STAR_EMOJI;
EDIT: My star emoji doesn't seem to be showing up in HN posts so image that STAR_EMOJI is actually https://emojipedia.org/star/

Re: Rust 1.53

#58
post #37

Earlier quoted context omitted.

For many, learning the low-level aspects of programming is the attraction of learning Rust. They want to be exposed to these concepts. What Rust does well is creating a golden pathway with guard rails through which one can learn these concepts without exposing oneself to the pitfalls of memory safety issues, thread safety issues and undefined behaviour.

I absolutely agree, this was the line I was arguing with: “You can then code with much the same convenience as e.g. Python, Java or C#”

Ah I see. My personal take is that while Rust introduces some inconveniences not present in those languages, those languages also have plenty of inconveniences that are not present in Rust. From my perspective, enums and traits are so much better than classes as abstractions that most of the productivity lost is already made back.

Re: Rust 1.53

#59
post #56
post #7

Earlier quoted context omitted.

Whether you should learn it or not I can't answer, but I want to mention that I personally don't feel anything in Rust is very esoteric. Python's metaclasses or JavaScript's prototype object model feel more unusual to me than anything I encountered in Rust. If you have never written in an unmanaged language like C++ though I could see that a lot of Rust feels foreign.

Lifetimes qualify as esoteric, I think. They seem unique to Rust (please correct me if wrong) and are not immediately intuitive.

C++ developers deal with lifetimes all the time (grep for "outlive" in a large codebase, for example). It just isn't baked into the language.

The notion of the "lifetime" is fundamental to systems programming, particularly when dealing with concurrency. It's quite natural to folks who are used to dealing with use-after-free/use-after-move and iterator invalidation bugs, imo.

Re: Rust 1.53

#60
I just recompiled rustc on my Linux From Scratch desktop. I guess I should have timed it, but it sure felt a lot faster. Finished when I wasn't even paying attention.

Went from 9 failed tests on 1.52.1 to 13 on 1.53.0.

I'm not expecting Firefox to compile, but that's entirely on Mozilla.

Post reply on HN