Live data from Hacker News

A Gentle Introduction to Rust

stevedonovan.github.io

41–50 of 60 posts

Re: A Gentle Introduction to Rust

#41
post #33

Earlier quoted context omitted.

Rust is better in that it enforces at language level best practices regarding memory use and thread safety, that are only possible in C++ via conventions or external tools like sanitizers. C++ still wins down on available compilers, supported hardware and OSes, IDEs, debuggers, libraries, GUI tooling, SIMD, GPGPU, industry certifications for critical systems, ... For example AUTOSAR just recently moved away from C to…

So nothing about ADT, pattern matching, modules, better std, explicit unsafe and cargo?

I skipped over modules, because Visual C++ and clang already have them in some form, it is a matter of getting them standardized in C++20.

Cargo is great, but C++ also has conan and vcpkg, eventually a standard one will emerge.

http://www.klabbers.nl/c/dependency-management-for-c/

Also I do have an issue with Cargo's lack of support for binary libraries.

ADTs, while not as good as in ML languages, at least there is std::variant.

I kind of mentioned explicit unsafe when I refereed to the safety enforced at language level instead of conventions and sanitizers.

Pattern matching is a great feature across all ML based languages, there were already some attempts to add it to the C++ as well.

http://open-std.org/JTC1/SC22/WG21/docs/papers/2016/p0095r1....

https://www.youtube.com/watch?v=HaZ1UQXnuC8

Re: A Gentle Introduction to Rust

#42

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…

Personally I really dislike documentation with this tone, written as if speaking to a minor, even when I was 11 yrs old and getting to know what programming is like.

Re: A Gentle Introduction to Rust

#43
post #41

Earlier quoted context omitted.

So nothing about ADT, pattern matching, modules, better std, explicit unsafe and cargo?

I skipped over modules, because Visual C++ and clang already have them in some form, it is a matter of getting them standardized in C++20. Cargo is great, but C++ also has conan and vcpkg, eventually a standard one will emerge. http://www.klabbers.nl/c/dependency-management-for-c/ Also I do have an issue with Cargo's lack of support for binary libraries. ADTs, while not as good as in ML languages, at least there is s…

Yes. C++ has all of this in a crippled form. But it doesn't mean that C++ in on par with Rust.

Re: A Gentle Introduction to Rust

#44
post #32

Earlier quoted context omitted.

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.

Hello, now you know me. I leave that special spot for C.

Say what you want about C, but at least it doesn't require reading several LotR length books, to be up to date with all the stuff.

Sadly, Rust, seems to be getting a few tomes of its own as well :P

Re: A Gentle Introduction to Rust

#45
post #41

Earlier quoted context omitted.

I skipped over modules, because Visual C++ and clang already have them in some form, it is a matter of getting them standardized in C++20. Cargo is great, but C++ also has conan and vcpkg, eventually a standard one will emerge. http://www.klabbers.nl/c/dependency-management-for-c/ Also I do have an issue with Cargo's lack of support for binary libraries. ADTs, while not as good as in ML languages, at least there is s…

Yes. C++ has all of this in a crippled form. But it doesn't mean that C++ in on par with Rust.

Not from technical perfection point of view, but it is much easier to improve existing codebases than just rewriting the world.

One of the things Rust should focus on as productivity improvement is making that migration as easy as possible.

Right now I cannot justify from business perspective replacing C++ with Rust on the workflows we still use C++ for.

Re: A Gentle Introduction to Rust

#46
post #44
post #32

Earlier quoted context omitted.

Hello, now you know me. I leave that special spot for C.

Say what you want about C, but at least it doesn't require reading several LotR length books, to be up to date with all the stuff. Sadly, Rust, seems to be getting a few tomes of its own as well :P

Actually it does, for anyone that cares about how to write portable and safe code in C.

There is this myth that C is a simple language, when devs stick to a single OS/compiler combo.

Re: A Gentle Introduction to Rust

#47
post #39
post #34

Earlier quoted context omitted.

You did not list any steps backwards just that the ecosystem is less mature

Sure I did, lack of SIMD and GPGPU support for example. If you prefer to be more specific, generics in Rust are still not as powerful as in C++, lacking const parameters and HKT, although they are coming. Also compile time code execution is not yet supported, although quite a bit can be achieved with macros.

Assuming nothing catastrophic happens in the next five days, https://github.com/rust-lang/rust/pull/49664 can be merged, by the way. So that'll be one thing off your list as of 1.27.

Re: A Gentle Introduction to Rust

#48
post #29
post #15

Earlier quoted context omitted.

> 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 i…

Arguably, school curricula are driven by the industry's needs. People keep asking for Java and Javascript developers, so that's what they have students learn.

Re: A Gentle Introduction to Rust

#49
post #45

Earlier quoted context omitted.

Yes. C++ has all of this in a crippled form. But it doesn't mean that C++ in on par with Rust.

Not from technical perfection point of view, but it is much easier to improve existing codebases than just rewriting the world. One of the things Rust should focus on as productivity improvement is making that migration as easy as possible. Right now I cannot justify from business perspective replacing C++ with Rust on the workflows we still use C++ for.

I'm not saying that you should ditch an existing C++ project.

But it doesn't mean that C++ as good as Rust. It's just wrong.

Re: A Gentle Introduction to Rust

#50
As a Go dev that learned programming via Zed Shaw's learn python the hard way, I have to say this tutorial made me want to learn rust. I've bookmarked for later, once I'm done learning dart/flutter.

Thanks Donovan

Post reply on HN