CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10

Thread: Rust

  1. #1
    Join Date
    Feb 2017
    Posts
    564

    Rust

    I was a C programmer who jumped on the Java bandwagon. Unfortunately Java never lived up to its hype for my kind of applications (which is scientific programs for the desktop). So it was a great relief when C++ 11 came along. It indicated a willingness to modernize C++. I immediately switched to it and never looked back. I'm very satisfied with C++ and looking forward to C++ 20 and beyond.

    My bad experience with Java has made me very suspicious of new languages. In my view Go, Python, D, Swift, Julia, Scala and the likes don't add enough value to be alternatives to C++. They're not even close.

    This month (June 2020) a new language made the TIOBE top 20 list,

    https://www.tiobe.com/tiobe-index/

    It's called Rust. It has been along for a while but, maybe due to its repulsive name, I've never bothered to check it out. Now I did and I must say I'm impressed. If you're a C++ programmer what do you think, is Rust a true alternative to C++ (if not right off, maybe in some cases under some circumstances)?
    Last edited by wolle; June 16th, 2020 at 01:40 AM.

  2. #2
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,255

    Re: Rust

    For over the past 25 years I've only used c/c++ - so I'm a little Rusty on the languages I used before then so can't comment.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2019 (16.7.3)

  3. #3
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,356

    Re: Rust

    I currently work in line of business applications. Visual Studio and C# is used and the code integrates with Azure (service bus, app services, event hub, storage, sql azure, and so on).

    When evaluating a language, a large consideration isn't the language features itself. Sure these are important, but the driving factor to me is the 'eco-system' around the language. Perhaps eco-system isn't the correct term but I'm referring to how the language lets me interact with the features of the OS, databases, and the cloud (Azure, AWS, etc.). Yes, I know these aren't language features per se, but this interaction is vitally important. For example, C++ is a fine language which I coded in for 10+ years, but by today's standards it's clunky when it comes to creating a web service or interacting with a database, to name a few drawbacks.

    I guess I should mention that I'm not a huge fan of open source, where I have to root around to try to find some package somewhere to get the functionality I need (the extent of my open-source adventureness for this old throwback is using nuget in C#).

    I see that RUST is supported on Visual Studio Code. I know that some folks really like Visual Studio Code, but after working in the full Visual Studio for 25 years, I find VSC lacking and unable to create the type of projects that I need.

    So as far as RUST, we're back to eco-system and while I haven't actually installed RUST on Visual Studio Code, it being in VS Code leaves me wondering if it supports the type of projects I'm interested in.
    Last edited by Arjay; June 16th, 2020 at 07:15 AM.

  4. #4
    Join Date
    Feb 2017
    Posts
    564

    Re: Rust

    Quote Originally Posted by Arjay View Post
    For example, C++ is a fine language which I coded in for 10+ years, but by today's standards it's clunky when it comes to creating a web service or interacting with a database, to name a few drawbacks.
    Yes, C++ is not the ultimate choice for every situation but it is preferred in many situations. Many large companies including Microsoft have started using Rust where they traditionally would've reached for C++, and are also replacing existing C++ code with Rust,

    https://thenewstack.io/microsoft-rus...s-programming/

    Please note the video by Ryan Levick embedded in that link which explains very well why Rust is so attractive.
    Last edited by wolle; June 16th, 2020 at 11:03 PM.

  5. #5
    Join Date
    Feb 2017
    Posts
    564

    Re: Rust

    Quote Originally Posted by 2kaud View Post
    For over the past 25 years I've only used c/c++ - so I'm a little Rusty on the languages I used before then so can't comment.
    Apart from the stint with Java I've also used only C/C++ professionally. I wouldn't say my Java period was a total waste, for example I got to learn OO thoroughly, but the main lesson I learned is that for some kinds of applications there's no way around C++. That is until now, entering Rust.

    Hopefully Stroustrup & Company come up with a response. Rather than adding even more "modern" features to C++ they now probably should start paying attention to the deep safety of C++. I think Rust is a wake-up call. It is corroding the very base of C++.
    Last edited by wolle; June 17th, 2020 at 01:13 AM.

  6. #6
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,255

    Re: Rust

    Hopefully Stroustrup & Company come up with a response.
    IMO I wouldn't hold your breath on this. There is an ISO working group/committee (WG21 - chaired by Herb Sutter from MS) which deals with the standard (as C++ is an ISO standard). The members are drawn/nominated from national standards bodies. The way this standards committee work is that meet 3 times a year and consider and vote on submitted proposals. Anyone can submit a proposal (which has to include the word changes to the Standard). A proposal usually goes through several rounds of changes until it is voted to be accepted at a meeting. There is no 'controlling mind' on how C++ is going to look, in say 2026. They're now working on the C++23 standard - mainly with proposals that didn't make it in time for the C++20 standard. See https://isocpp.org/

    Have an idea for a change to C++? Then submit a proposal. Just make sure you know the wording of the official ISO C++ standard first (it's over 1600 pages)!
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2019 (16.7.3)

  7. #7
    Join Date
    Feb 2017
    Posts
    564

    Re: Rust

    Quote Originally Posted by 2kaud View Post
    Have an idea for a change to C++? Then submit a proposal.
    I would if I could but as an ordinary Joe programmer I'm not qualified. I have to select from what's offered and hope to make the right choice. Reading books and articles, watching guru presentations and having discussions in forums like this. That's the options left for most of us, isn't it?

  8. #8
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,255

    Re: Rust

    Quote Originally Posted by wolle View Post
    I would if I could but as an ordinary Joe programmer I'm not qualified. I have to select from what's offered and hope to make the right choice. Reading books and articles, watching guru presentations and having discussions in forums like this. That's the options left for most of us, isn't it?
    The problem for 'Joe programmer' is that the committee considers proposals for word changes to the standard to bring new ideas into the language. There's no restriction on who can submit, but the submitter needs to know the standard documentation and how it needs to be changed for a particular proposal. Unfortunately what you can't do is say to WG21 'I have an idea for feature xyz - but I need help writing the proposal to change the standard'. Every new feature in the language has a formal paper describing it. Eg the C++20 feature for Designated Initialization is described at http://www.open-std.org/jtc1/sc22/wg...17/p0329r4.pdf - and similarly for every other feature. The list for each revision to the standard is at https://en.cppreference.com/w/cpp/compiler_support

    Every proposal is considered by the WG21 members and is voted upon, requiring a majority to vote in favour in accept. Once a proposal has been voted to accept, it becomes part of the next standard. If a proposal is rejected, it can be changed as per suggestions from WG21 and re-submitted. Some proposals go through 4 or more iterations before they are finally accepted - which is why some changes expected in a particular release of C++ don't make it but appear in the next release (the releases of C++ are now strictly every 3 years). C++20 is fixed for features and they're now working on C++23.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2019 (16.7.3)

  9. #9
    Join Date
    Feb 2017
    Posts
    564

    Re: Rust

    Quote Originally Posted by 2kaud View Post
    There's no restriction on who can submit, but the submitter needs to know the standard documentation and how it needs to be changed for a particular proposal.
    Well, that definitely makes it very hard for 'Average Joes' like me to accomplish changes to C++.

    But what you describe is the formal process. The C++ committee can also act informally by inviting experts to submit certain proposals. I'm sure many members of the committee are aware of the threat from Rust and are pulling the necessary strings for the committee to be able to do something about it. After all, the committee consists of individuals who care about the future of C++ and they will not just sit around passively waiting for proposals.

    Anyway, I've only been aware of Rust for like a fortnight but it's the first time since Java I feel this is something I really want to seriously consider. But since Java turned out a mistake I'm more careful this time, hence this thread.
    Last edited by wolle; June 18th, 2020 at 12:56 AM.

  10. #10
    Join Date
    Feb 2017
    Posts
    564

    Re: Rust

    After having further investigated Rust I've decided it is too immature at this point. It's not as much the language itself as it is the lack of mature third party libraries. I need stable subsystems for low-level graphics and portable GUI and I haven't found any for Rust. This is not surprising. As a new language Rust cannot match the legacy of C/C++.

    It is possible for Rust and C++ to interoperate by way of C,

    https://hsivonen.fi/modern-cpp-in-rust/

    but it doesn't seem to be a high priority objective to make this easy. It may be a strategic mistake and prolong a wider acceptance of Rust.

    So I'll stick with C++ for my next project but keep Rust in mind for the future. Thanks for your input!
    Last edited by wolle; July 4th, 2020 at 03:07 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)