News for hackers. Stuff that matters.
Re:A Gentle Introduction to Rust by banachtarski on Thursday April 12, 2018 @01:45AM (#16818332)
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.
Re:A Gentle Introduction to Rust by exceptione on Thursday April 12, 2018 @04:41AM (#16819036)
«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 by pjmlp on Thursday April 12, 2018 @05:45AM (#16819294)
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 C++14 as suggested language for car computer systems, imagine how long it will take for them to suggest other language.

Re:A Gentle Introduction to Rust by RazrFalcon on Thursday April 12, 2018 @07:19AM (#16819672)
So nothing about ADT, pattern matching, modules, better std, explicit unsafe and cargo?
Re:A Gentle Introduction to Rust by pjmlp on Thursday April 12, 2018 @07:33AM (#16819756)
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 by RazrFalcon on Thursday April 12, 2018 @08:07AM (#16819973)
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 by pjmlp on Thursday April 12, 2018 @08:46AM (#16820275)
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 by RazrFalcon on Thursday April 12, 2018 @10:56AM (#16821559)
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 by pjmlp on Thursday April 12, 2018 @01:25PM (#16823059)
A programming language is not just a grammar and semantics.

The whole eco-system and community around a language is what defines it.

To give a more explicit example, until it reaches parity with C++ on .NET/UWP tooling, it just means less productivity in spite of being a technically better and safer language.

Re:A Gentle Introduction to Rust by rapsey on Thursday April 12, 2018 @05:58AM (#16819345)
You did not list any steps backwards just that the ecosystem is less mature
Re:A Gentle Introduction to Rust by pjmlp on Thursday April 12, 2018 @06:47AM (#16819526)
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.

Re:A Gentle Introduction to Rust by steveklabnik on Thursday April 12, 2018 @09:26AM (#16820644)
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 by banachtarski on Thursday April 12, 2018 @03:26PM (#16824117)
I write multithreaded code all the time. I simply do not encounter the amount of "pain" that is touted as the reason things like the borrow checker need to exist. Generally, you write abstractions around synchronization and asynchronous dispatch and then just use them. C++ works on platforms like PS4, mobile devices, embedded, and more already with good support from vendor toolchains. If I use Rust, I have to use all these wrapping libraries or write my own. Yea the syntax can be pretty in some ways, but I already have structured bindings in C++17 and a whole bunch of other things I can do.
Re:A Gentle Introduction to Rust by steveklabnik on Thursday April 12, 2018 @05:14PM (#16824998)
Rust does work on game consoles, embedded platforms, mobile, and more as well.

That said, you should use tech that you’re happy with.

Re:A Gentle Introduction to Rust by banachtarski on Thursday April 12, 2018 @05:37PM (#16825133)
Yea I realize it compiles to LLVM and this can technically target anything. It's the toolchain, profiler, and debugger maturity that worries me.

> That said, you should use tech that you're happy with

Yea this summarizes what I was going for originally. Newcomers may benefit more learning Rust (I don't actually know this for sure).

Re:A Gentle Introduction to Rust by steveklabnik on Thursday April 12, 2018 @05:52PM (#16825224)
Yeah, we’ll see. Chucklefish, as far as I know, has been happy. I did a presentation at an Activision studio yesterday. We’ll see!
Re:A Gentle Introduction to Rust by MrBuddyCasino on Thursday April 12, 2018 @05:34AM (#16819263)
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.
Re:A Gentle Introduction to Rust by banachtarski on Thursday April 12, 2018 @03:24PM (#16824091)
There are dozens of us. Dozens! You need to search for programmers that have problems in the microsecond to millisecond scale.
Re:A Gentle Introduction to Rust by pjmlp on Thursday April 12, 2018 @05:39AM (#16819281)
Hello, now you know me. I leave that special spot for C.
Re:A Gentle Introduction to Rust by Ygg2 on Thursday April 12, 2018 @08:44AM (#16820265)
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 by pjmlp on Thursday April 12, 2018 @08:48AM (#16820298)
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 by Ygg2 on Friday April 13, 2018 @12:18PM (#16831426)
C is a simple language. It has order of magnitude less concepts than C++. It's application is complex.

In same way Lisp is a simple language, but its application can be just as complex.