Live data from Hacker News

Rust's 2018 roadmap

blog.rust-lang.org

201–210 of 253 posts

Re: Rust's 2018 roadmap

#201
post #119
post #114

Okay, after two failed attempts (mainly due to lack of motivation, I hasten to admit), I think it's time for me to learn me some Rust. I spent a long time working mostly with dynamically typed languages, but over the past few years, I have slowly drifted back into statically typed territories. At home, I have used Go a lot, at work, I have grown to like C#. Rust kind of looks like the next logical step along that tra…

If you have any questions, feel free to come ask at /r/rust, where we strive to be moderately less of a shithole than reddit in general. :)

The same way a 4 star hotel is «moderately less of a shithole» than a slum ;)

Re: Rust's 2018 roadmap

#202
post #96

Earlier quoted context omitted.

Rust in general isn't really a beginner's language. You have to understand computers at a very low level to appreciate the design choices. Given some dedication, it'll help you at that but it's not easy, especially if you already know some higher level languages. It's probably easier to teach it as a first language than a second after Python or Java.

Can you clarify your meaning? I'm a little confused. It sounds like you say "Rust isn't really a beginner's language... it's probably easier to teach [Rust] as a first language than a second after Python or Java". At first it sounds like a contradiction but when I inspect closer I realise there's alternative interpretations. Do you mean "learning a system's programming language is not helped and may even be hindered…

Steve got it right. I'll clarify nevertheless: Rust and computer architecture (caveats apply) are (IMHO) very good subjects to be taught in tandem, as Rust tries very hard to provide safety features and high level abstractions that are impossible to implement in general, but quite possible in special, if very common, cases. Seeing where it is possible and where it's not and why should be an eye-opening experience.

The operative word here is actually 'taught' - I think it's just too much stuff to internalize to be able to read a few tutorials and get it. It's a topic for multiple semesters of structured teaching going together with lots (lots!) of practical excercises. In that sense, it's easier to be taught if you don't know anything about programming than if you have a wrong mental model of how programming languages work, because you have to unlearn it first or open your mind in some other way for a different way of doing things. (The post that I was replying to asked why would you want four different string types - and you actually need at least six to interact with C libs and the OS...)

Re: Rust's 2018 roadmap

#203
post #65

I started learning Rust over the weekends and I think the second edition "The Rust Programming Language" is among the best introductory books on a programming language I have read (well half way so far). As someone not only new to Rust but also systems programming in general I especially appreciate that the chapters include actual reasoning about why things are how they are in Rust and that they seem pretty open abou…

My sister ordered me a copy of that book on Amazon for my birthday in mid-2016. Then she was surprised that it was a pre-order and I wouldn't get it until October.

It still isn't done. Like a good wine I guess.

Re: Rust's 2018 roadmap

#204

Earlier quoted context omitted.

> let hello = String::from("שָׁלוֹם"); This brings back PTSD for anyone who implemented ad-hoc RTL and UTF-16 surrogate pairs support in an environment that lacked them. Thank g-d I insisted that we at least omit diacritics as nobody uses them and they're a huge pain to implement and QA properly. Also, can we please, please, please keep source code files as pure ascii? Asking as a non-native english speaker. There're…

> Also, can we please, please, please keep source code files as pure ascii How do you propose that we write programs that interact with non-ASCII compatible language users? All string literals are to be saved in external, somehow non-source code files? How would you go about writing a Chinese "Hello World"? In Python 3, I would write print("你好,世界!") I have no idea how you propose this should be done in pure ascii.

I'm not opposed to unicode in source code, but we do put all string literals in external files, by using gettext.

Your example would be:

    print(_("Hello World!"))
And then a zh.po file with:

    #: file.py:1
    msgid "Hello World!"
    msgstr "你好,世界!"

Re: Rust's 2018 roadmap

#205

Earlier quoted context omitted.

> let hello = String::from("שָׁלוֹם"); This brings back PTSD for anyone who implemented ad-hoc RTL and UTF-16 surrogate pairs support in an environment that lacked them. Thank g-d I insisted that we at least omit diacritics as nobody uses them and they're a huge pain to implement and QA properly. Also, can we please, please, please keep source code files as pure ascii? Asking as a non-native english speaker. There're…

> Also, can we please, please, please keep source code files as pure ascii? Asking as a non-native english speaker. I'm a non native English speaker. That's why I hate tools, and websites which don't understand that people have different letters in names. Just use good tools.

I agree that tools should be better, but i believe that "just use good tools" might not be a viable solution for the parent.

Re: Rust's 2018 roadmap

#207

Earlier quoted context omitted.

> Also, can we please, please, please keep source code files as pure ascii How do you propose that we write programs that interact with non-ASCII compatible language users? All string literals are to be saved in external, somehow non-source code files? How would you go about writing a Chinese "Hello World"? In Python 3, I would write print("你好,世界!") I have no idea how you propose this should be done in pure ascii.

I'm not opposed to unicode in source code, but we do put all string literals in external files, by using gettext. Your example would be: print(_("Hello World!")) And then a zh.po file with: #: file.py:1 msgid "Hello World!" msgstr "你好,世界!"

This assumes then programmer speaks English and Chinese is a "translation".

Re: Rust's 2018 roadmap

#208

Earlier quoted context omitted.

> Also, can we please, please, please keep source code files as pure ascii How do you propose that we write programs that interact with non-ASCII compatible language users? All string literals are to be saved in external, somehow non-source code files? How would you go about writing a Chinese "Hello World"? In Python 3, I would write print("你好,世界!") I have no idea how you propose this should be done in pure ascii.

print("\u4f60\u597d\uff0c\u4e16\u754c\uff01") I'd guess?

in which case you'll need to add a comment to remember what it says:

    print("\u4f60\u597d\uff0c\u4e16\u754c\uff01") # "你好,世界!"

Re: Rust's 2018 roadmap

#209
post #123

Earlier quoted context omitted.

let hello = String::from("السلام عليكم"); let hello = String::from("Dobrý den"); let hello = String::from("Hello"); let hello = String::from("שָׁלוֹם"); let hello = String::from("नमस्ते"); let hello = String::from("こんにちは"); let hello = String::from("안녕하세요"); let hello = String::from("你好"); let hello = String::from("Olá"); let hello = String::from("Здравствуйте"); let hello = String::from("Hola"); This is such a beaut…

> let hello = String::from("שָׁלוֹם"); This brings back PTSD for anyone who implemented ad-hoc RTL and UTF-16 surrogate pairs support in an environment that lacked them. Thank g-d I insisted that we at least omit diacritics as nobody uses them and they're a huge pain to implement and QA properly. Also, can we please, please, please keep source code files as pure ascii? Asking as a non-native english speaker. There're…

> can we please, please, please keep source code files as pure ascii? Asking as a non-native english speaker. There're a lot of tools

If there are tools that break when this happens, those tools need to be fixed. Bugs in those tools need to be found (through usage) and reported. If we avoid the problem by strictly sticking to ascii in source files, that amounts to sweeping those bugs under the carpet.

Furthermore, another commenter said "use good tools". The inverse of this—don't use bad tools—is important: developing tools that correctly handle encoding issues needs to be seen by developers as a priority. There needs to be a ramification (in the form of bug reports, complaints, etc.) if encoding issues are not considered by tool makers.

Re: Rust's 2018 roadmap

#210
post #65

I started learning Rust over the weekends and I think the second edition "The Rust Programming Language" is among the best introductory books on a programming language I have read (well half way so far). As someone not only new to Rust but also systems programming in general I especially appreciate that the chapters include actual reasoning about why things are how they are in Rust and that they seem pretty open abou…

Long for sure, but I really miss practical use cases, for example:

> Asked how long the string is, you might say 12. However, Rust’s answer is 24:

I get that, `.len()` is tricky, but why not include an easy, common way to determine character length of a string in the documentation?

Post reply on HN