Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming.threads > #3954
| From | Intelli2 <intelli2@mama.com> |
|---|---|
| Newsgroups | comp.programming.threads |
| Subject | C++ or Rust ? |
| Date | 2017-12-04 15:40 -0500 |
| Organization | A noiseless patient Spider |
| Message-ID | <p04br4$rfr$3@dont-email.me> (permalink) |
Hello, Read this: === I have used Rust quite a bit and even managed to create a video course on it. While I enjoy Rust, it cannot really compete with C++ because: C++ is object-oriented, Rust isn't like C++. My observations about Rust: Simple OOP is easy, but you'll often find that straight procedural is simpler once you stop thinking of everything as an object. Abstract classes are not really possible, very clunky work-arounds. Say you have an Abstract class that implements 95% of the functionality, but you want your user to implement the last 5% and then supply the class to your library. This is easy to do in Rust, but requires the user to implement essentially a wrapper around the Abstract struct. It exposes a lot of ugly API to end-users. There are workarounds (using closures, etc) but the resulting API is ugly either way. Polymorphism and generics are non-trivial and requires hoop-jumping. The mental hurdle for me is that traits != types. I often find myself wanting to declare a variable as a trait: e.v. Vec<Amphibian>, where Amphibian is a trait. I want a vector of amphibians and don't care what the actual implementation is. You can't do this however. Instead, you often have to wrap everything in an enum and then dispatch methods to the underlying type. My observation about C++: The Intel compiler, terrible as it is, give the 'absolute most' performance in terms of SSE and auto-parallelism. I do find some of IPS tools gimmicky but the compiler gives the numeric performance I need. A good IDE (CLion and ReSharper C++) is an absolute must for me. Intel Parallel Studio tools such as VTune are epic and I don't see anything in the Rust space. C++ ecosystem has all the libs I need, even if I don't enjoy those APIs as much. For example, if I want motion graphics, I grab Direct2D/DirectWrite and FFMPEG and I'm good to go. Modern C++ is a lot of fun to learn and use, there's plenty of evolution of the language and a neat community. === Thank you, Amine Moulay Ramdane.
Back to comp.programming.threads | Previous | Next | Find similar | Unroll thread
C++ or Rust ? Intelli2 <intelli2@mama.com> - 2017-12-04 15:40 -0500
csiph-web