Thread: Is Rust-Lang a replacement for C or C++?

  1. #1
    Registered User
    Join Date
    Aug 2019
    Posts
    1

    Post Is Rust-Lang a replacement for C or C++?

    Hello,
    Is Rust-Lang a replacement for C\C++? I mean is that can most programs that written in C will rewritten in Rust-Lang in the future?

    Thank you.

  2. #2
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,728
    lol, no. Don't believe everything 4chan tells you.
    Devoted my life to programming...

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,493
    Moved to tech board.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    Informer -Adrian's Avatar
    Join Date
    Jan 2013
    Posts
    814
    Quote Originally Posted by hack3rcon View Post
    Is Rust-Lang a replacement for C\C++?
    It aims to be.

    I mean is that can most programs that written in C will rewritten in Rust-Lang in the future?
    Can: yes. Will: no. C++ and especially C will stay relevant for a very long time.

    If you're asking because you wonder if C and C++ are worth learning, then the answer is yes. The Rust ecosystem wins with web (backend) development because of the many libraries targeting that.

  5. #5
    Registered User
    Join Date
    May 2019
    Posts
    209
    Is Rust-Lang a replacement for C\C++?
    C was purposely created to replace an assembler (to be a CPU independent assembler level language) to write the UNIX operating system.

    Rust isn't targeting such a direction. It is not for use in place of an assembler for such purposes. You may find C used for other targets, sometimes where other languages might be a better fit. It is used at a higher level than assembler, but many of the fundamental constructs of C translate into 1 or 2 machine language instructions to a degree sufficient to target operating systems, device drivers and other related targets.

    C++ was created to address a wide mixture of targets, raising the upper level features of the C language (through objects, libraries and other features), while retaining most (if not all) of C's "close to the metal" capabilities.

    Several languages, including Rust, may well intend to target the upper application region where C++ is often used, but can't quite manage to do all that C++ does from one end of that spectrum to another.

    For that matter, several languages have attempted the same, from Java and C# to Swift and others.

    Where simplicity and rapid development are priorities, some of those languages, including Rust, attract considerable interest.

    Consider, however, why. There is a practical point from a business perspective which promote language use like Java and C#. It allows business to trust lesser skilled programmers where the language "protects" them from "themselves", while allowing for rapid development of target projects.

    There's nothing wrong with such a choice, but where ambitious target applications require a priority on performance, there is still nothing that can fully replace C++, especially considering the long history and wide library support available in C++.

    As long as there are operating systems, there will be C. Linux, UNIX and Windows are written in C. By extension, that means Android (Linux) and Apple(UNIX) are, too.

    That will not change. Some of that code base goes back decades.

    In high end application development, most are built in C++. From Photoshop to 3DS Max, AutoCAD to Revit, most SQL engines and the best audio workstations, the largest and most competitive, most sought after by the market are built in C++.

    Some of them have code bases going back decades.

    In gaming, most engines are built in C++. Most physics engines are built in C++. Most audio engines are built in C++ or C.

    Shear inertia would imply that if a language were to replace C++, it would have to overcome all that history, all the expertise, and the entire standing codebase upon which large corporations are built in order to motivate a transfer to another language.

    At best, Rust could take advantage of an emerging niche where the timing was right.

    PHP is a popular web-server side language. While there is a lot of PHP code, and libraries supporting that, there's good reason to believe other languages would offer vastly superior performance and return on investment if PHP were replaced.

    Were languages have been lost, it is usually along that line, where something seriously superior appears and the legacy code is not that important to retain.

    Even as a contender like Rust appears, it would also have to compete with the fact that C++ is evolving, and with some very powerful results. C++ is not a stagnant, vulnerable target like COBOL.

    From a technical standpoint, the D programming language is in a better position to replace C++, and I'll bet you're asking yourself "what is D?"
    Last edited by Niccolo; 08-14-2019 at 04:18 PM.

  6. #6
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    Everyone knows Java is the real C++ killer.

    Soma *runs away*
    “Salem Was Wrong!” -- Pedant Necromancer
    “Four isn't random!” -- Gibbering Mouther

  7. #7
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,656
    Quote Originally Posted by phantomotap View Post
    Everyone knows Java is the real C++ killer.

    Soma *runs away*
    This is the year of the li̶n̶u̶x̶ ̶d̶e̶s̶k̶t̶o̶p̶ JVM.

  8. #8
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    Yo!

    How's university treating you this time around?
    “Salem Was Wrong!” -- Pedant Necromancer
    “Four isn't random!” -- Gibbering Mouther

  9. #9
    Registered User catacombs's Avatar
    Join Date
    May 2019
    Location
    /home/
    Posts
    72
    Quote Originally Posted by hack3rcon View Post
    Hello, Is Rust-Lang a replacement for C\C++? I mean is that can most programs that written in C will rewritten in Rust-Lang in the future?
    Rust aims to be a C/C++ replacement, but it has a long way to go. There are a lot of legacy systems written in C/C++ that would cost too much time and money to be rewritten in Rust.

    C/C++ are safe for the foreseeable, but it wouldn't hurt learning Rust, if you want to write experimental programs.


    Quote Originally Posted by GReaper View Post
    lol, no. Don't believe everything 4chan tells you.
    /g/ is sometimes right about things. In terms of Rust, it's a never-ending flame war, mostly fueled by childish transphobia.

  10. #10
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,656
    Quote Originally Posted by phantomotap View Post
    Yo!

    How's university treating you this time around?
    Awesome, so far!

  11. #11
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,859

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C++ and Rust
    By joe232 in forum C++ Programming
    Replies: 3
    Last Post: 01-20-2019, 05:43 PM
  2. C and Rust
    By joe232 in forum C Programming
    Replies: 1
    Last Post: 01-20-2019, 05:44 AM
  3. So, what do we think of Rust?
    By MutantJohn in forum General Discussions
    Replies: 16
    Last Post: 12-28-2015, 09:50 PM
  4. Let's talk about Rust!
    By Neo1 in forum General Discussions
    Replies: 167
    Last Post: 06-26-2014, 07:17 AM
  5. Posting on comp.lang.c++ and comp.lang.c++.moderated
    By SilentStrike in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 05-24-2002, 08:27 PM

Tags for this Thread