5 ms·
that compiles to C++ and has 2 decades of libraries and tools written for it?
by something123 11y ago
that compiles to C++ and has 2 decades of libraries and tools written for it?
- pcwalton 11y agoRust compiles to LLVM IR, which is better than compiling to C++ (for reasons I've elaborated on before). As for library and tool support, I think a safe subset of C++ couldn't actually use tools for "real" C++, because the languages would be too different.
- something123 11y agoI'm sorry, but I feel like all these "Just use Rust!" comments are written by idealistic college students. Yes, maybe Rust is better, and maybe if we could push a button and make everyone use it the world would be a better place. But the reality is that there are very few code bases written in Rust and an uncountable amount written in C++ - there are decades of work behind C++ and decades of work will still be done in C++. I need to earn a living TODAY and work in the current reality, and I need tools to help me be more productive. I can't wait 5 years for some brand new language to take over.
- yokohummer7 11y agoI think you're misinterpreting what pcwalton said. Sure, seeing "use Rust" in every possible place is quite annoying, but what pcwalton described is why "compiles to C++" and "has 2 decades of libraries" don't work for new languages. He didn't say to use Rust, he was just pointing out that your two ideas aren't viable.
- kllrnohj 11y ago> But the reality is that there are very few code bases written in Rust and an uncountable amount written in C++ Most libraries use a C ABI due to it being stable, and Rust has fantastic FFI support for C (although tools to take in a .h and spit out the FFI in Rust are definitely needed). There's no performance cost to FFI in Rust, either, it's just a function call. As someone that spends a lot of time in an existing C++ codebase, FFI with zero overhead offers a very enticing migration path. But as you were asking about making a new language, I was just pointing out the language you were starting to design has already been built.
- kllrnohj 11y ago> But the reality is that there are very few code bases written in Rust and an uncountable amount written in C++ Most libraries use a C ABI due to it being stable, and Rust has fantastic FFI support for C (although tools to take in a .h and spit out the FFI in Rust are definitely needed). There's no performance cost to FFI in Rust, either, it's just a function call. As someone that spends a lot of time in an existing C++ codebase, FFI with zero overhead offers a very enticing migration path. But as you were asking about making a new language, I was just pointing out the language you were starting to design has already been built.
- yokohummer7 11y agoBut wouldn't factoring out the obsolete features limit the libraries that are available to use? I thought that was the point of the newly developed systems languages. Even if you follow some "sane" parts of the language, the rest of the ecosystem won't agree with you. Just look at this thread, there are tons of disagreements in what a good C++ code is.