8 ms·
Or nothing at all. Rust has an uphill battle since 10 years which shows it's hard to replace C / another language. Might be Rusts borrow checker that prevents a
by KingOfCoders 5y ago
Or nothing at all. Rust has an uphill battle since 10 years which shows it's hard to replace C / another language. Might be Rusts borrow checker that prevents adoption, but I doubt it (though it's the reason I use Rust but don't love it).
- dralley 5y agoRust has only been post-1.0 for 7 years.
- KingOfCoders 5y agoI agree, though to me it's not great of a difference if something is struggling for 7 or 10 years [1] [1] just for reference, 0.1 was announced 2012, 10 years ago, 1.0 was announced 2015, 7 years ago.
- cjg 5y agoAccording to PyPL's numbers, Rust's growth in popularity has been pretty much exponential since 1.0 with a doubling every ~15 months.
- wiremine 5y agoI've always felt Rust completes more directly with something like C++. It's not nearly as expansive, but the mental space and use cases feel more C++-ish to me. Languages like Zig feels more like a replacement for C.
- ZeroCool2u 5y agoI think one thing that has helped Rust make the first serious advances towards C that we've seen in a long time is also the development tool chain. Getting started with Rust on any major platform, besides embedded development though that's coming along, is so much easier with Rustup and Cargo than the bizarre (to the uninitiated) work you have to do to setup and actually understand your development tool chain in C as well as C++.
- IgorPartola 5y agocc main.c is about as easy as it gets, no?
- linkdd 5y agoNow add some dependencies, some required, some optional, for all platforms, or some specific to some platforms. Then add configuration options for conditional compilation, and a build system to define them properly. Then use the configuration options of your dependencies in your build system. Finally, repeat this process for every project and make sure you use the same syntax/api for your build system so you don't have to relearn everything everytime. cc main.c is as easy as it gets when you rewrite everything from scratch. cargo is as easy as it gets when you want an ecosystem.
- snovv_crash 5y agoAdd a closed source dependency in Rust and see how far cargo takes you.
- linkdd 5y agoI assume the closed source dependency is distributed as a .a/.so/.dll file, then you can use bindgen[0]. Still, yes it's a bit more complicated. But can we not pretend that the non-existent toolchain in C/C++ is easier in 99% of use cases? [0] - https://medium.com/dwelo-r-d/using-c-libraries-in-rust-13961948c72a https://medium.com/dwelo-r-d/using-c-libraries-in-rust-13961...
- snovv_crash 5y agoNo, I want a closed source Rust dependency. Otherwise it's going through a C API and I lose all of the benefits of using Rust. Once you solve this problem, C++ & CMake are of similar complexity for C++ dependencies. Otherwise to compare C++ toolchains, if it's distributed as a .a file, just adding -l/path/to/libclosed.a works for C++, can't get more simple than that. Or one line in the CMake file with basically the same thing.
- sanxiyn 5y agoRust just crossed 10% in Firefox. Rust is steadily replacing C and C++ in Firefox, as it was designed to do. https://4e6.github.io/firefox-lang-stats/ https://4e6.github.io/firefox-lang-stats/
- einpoklum 5y agoYou mean, in the application maintained by the organization which devised Rust and is its main proponent? Someone I am not very impressed.
- sanxiyn 5y agoRust was created to improve the situation where web browsers are written in C++. (I hope we can agree this is bad.) It was not created to impress you.
- dralley 5y agoThe combined total of Rust, C, and C++ is only about half of the Firefox codebase. So it's more like 20% (of the code that it might theoretically replace). Because the code written in HTML and Javascript isn't going to be rewritten in Rust another language, probably ever.
- audunw 5y agoI think the problem with Rust and most other languages, is illustrated by what Zig (for me) does right: My main motivation for using Zig is that it's rapidly becoming a better C toolchain that GCC or Clang. So I'm extremely motivated to compile all my C code with Zig when it becomes possible. After that it's only natural to write more of my code in Zig. So, my hypothesis is, a language that could replace C has to have a better C compiler built-in than existing C compilers. Another side of this, is that it has to be extremely easy to use C from the new language and vice-versa. Something I also think Zig does mostly right.
- atq2119 5y agoThis is a pretty good hypothesis given the history of C++.
- cestith 5y agoI don't know about better, but at least almost as good of a C compiler built in seems like a big selling point. So that's, what, Objective C, C++, D, and Zig? Perl has Inline::C that allows snippets of C code to be placed directly into Perl code like many C and Pascal compilers allow inline assembly. That's for interoperation and an occasional optimization of course, since Perl is in no way a C replacement for much of what's done in C. Do you foresee a replacement language having such inline sections, being a superset language like C++ or Objective C, or being able to just handle separate files/modules in separate languages?