Live data from Hacker News

A Gentle Introduction to Rust

stevedonovan.github.io

21–30 of 60 posts

Re: A Gentle Introduction to Rust

#21

Speaking as someone who's poked around at the edges of Rust and always come away frustrated, the Rust world does need a "gentle introduction". But while this document seems to understand that need, it gets messy pretty fast. First of all, the introduction is all over the place, and poorly structured. There first section asks "Why Learn a new Programming Language?" but never answers that question (beyond "it's good me…

I think you are a little unfair, expecting the guide to be towards complete beginners who would get confused by the language having curly braces or not... Rust is not a first language, it's a systems programming language. For previous programmers, the guide looks pretty good to me.

Rust could be really great first language. After learning Rust programmer will write much more safe code.

Re: A Gentle Introduction to Rust

#22
What makes Rust still rather inaccessible for me is the difficulty in finding «functions I can apply to an argument of type X» and «functions that return a value of type Y» other than, “read every last bit of API doc about everything and memorize it”.

Re: A Gentle Introduction to Rust

#23
post #14
post #9

Earlier quoted context omitted.

> Why does every single rust promoting article have to bash on c++? Because it was built to be a C/C++ replacement. > They built a GC, good job. ?

> Because it was built to be a C/C++ replacement. That doesn't mean discussions including it have to bash C or C++. In fact, there is supposedly a very high standard in the official Rust community against bashing other languages. Plenty of languages have completely replaced or circumvented C and C++ (i.e., out-competed them) in their respective niches without it being a heated two-minutes hate every time discussions…

> That doesn't mean discussions including it have to bash C or C++.

One mans critique is another mans bashing. Though admittedly I did not really read the article.

Re: A Gentle Introduction to Rust

#24
post #20

Earlier quoted context omitted.

"Disaffected C++ programmer" is altogether too accurate characterization of the author :). I've been removing references to other languages because (a) it's confusing (b) can be dismissive ("trash talking") - a language should stand on its own merits. So yes, a first draft. I try to express the paradox - that although Rust is about explicitness, type inference hides the actual concrete types chosen - `f64` and `i32`…

So the uses are pretty hardcore: operating systems, device drivers and embedded systems that might not even have an operating system I think this falls a little short. Think of tools like ripgrep which make use of C/C++-class speed with higher level language features.

I'm a big fan of ripgrep, and there's been a minor revival of command-line tools exploiting the speed + higher-level + reusable-crates that Rust provides. So 'hardcore' is not correct. I've personally found it very effective at writing such tools - I struggle a little more, but debug less.

Let's not forget server-side: I'm still recovering from the trauma of mysterious segfaults when doing C++ on the server, which can easily happen with multithreading and are an absolute bastard to diagnose and fix.

Re: A Gentle Introduction to Rust

#25

What makes Rust still rather inaccessible for me is the difficulty in finding «functions I can apply to an argument of type X» and «functions that return a value of type Y» other than, “read every last bit of API doc about everything and memorize it”.

That would be what Hoogle is for Haskell: https://www.haskell.org/hoogle/

Could you start by grepping API docs?

Re: A Gentle Introduction to Rust

#26
post #25

What makes Rust still rather inaccessible for me is the difficulty in finding «functions I can apply to an argument of type X» and «functions that return a value of type Y» other than, “read every last bit of API doc about everything and memorize it”.

That would be what Hoogle is for Haskell: https://www.haskell.org/hoogle/ Could you start by grepping API docs?

> grepping API docs

Of course, but that's still painfully slow and awkward. It's exactly the kind of repetitive crap we programmers are born to automate.

Re: A Gentle Introduction to Rust

#27

What makes Rust still rather inaccessible for me is the difficulty in finding «functions I can apply to an argument of type X» and «functions that return a value of type Y» other than, “read every last bit of API doc about everything and memorize it”.

When you search in the API documentation, you will find 3 tabs at the top: "In Names", "In Parameters" and "In Return Types".

Example: https://doc.rust-lang.org/std/?search=option

Re: A Gentle Introduction to Rust

#28
post #9

Earlier quoted context omitted.

> Why does every single rust promoting article have to bash on c++? Because it was built to be a C/C++ replacement. > They built a GC, good job. ?

To me, it feels like Rust really only has value to people who aren't already using C++14/17. The incremental benefit in certain areas is small, and it steps backwards in other areas.

«The incremental benefit in certain areas is small, and it steps backwards in other areas.»

As someone who doesn't know about C++ and Rust, can you elaborate on that?

Re: A Gentle Introduction to Rust

#29
post #15

Earlier quoted context omitted.

I think you are a little unfair, expecting the guide to be towards complete beginners who would get confused by the language having curly braces or not... Rust is not a first language, it's a systems programming language. For previous programmers, the guide looks pretty good to me.

> Rust is not a first language, it's a systems programming language. Since when are sys prog langs not introductory languages anymore? I understand that using an dyn typed, interpreted, GCed lang is easier to get started with; but a whole (2) generation(s) of programmers has started with systems programming as their first experience, and I must say they seem well equipped for they jobs (maybe better so than those onl…

At my university course, we did C in the first year for all programming courses. THen onto C++ in year 2 onwards, but all the fundamentals were in C.

Now that same course goes straight to Java as the introductory language, alongside html / css and javascript.

Now any sort of low(er) level language is avoid until year 2 when they do a course on C / C++

Which seems ass backwards to me.

I also see some developers come into the industry now who have never done anything lower level than Java or javascript at all

Re: A Gentle Introduction to Rust

#30
post #9

Earlier quoted context omitted.

> Why does every single rust promoting article have to bash on c++? Because it was built to be a C/C++ replacement. > They built a GC, good job. ?

To me, it feels like Rust really only has value to people who aren't already using C++14/17. The incremental benefit in certain areas is small, and it steps backwards in other areas.

Maybe I'm living in a special kind of bubble, but I have yet to meet a C++ programmer IRL who doesn't hate it.
Post reply on HN