This is probably an unpopular opinion, but I find modern C++ with templates and constexpr to be quite fun, mainly from the perspective of trying to do as much at compile-time as possible. Most of the resulting code is nearly incomprehensible and never gets used for anything outside of a godbolt demo, but trying to do complex tasks within the limited and unintuitive world of compile-time evaluation is something I’ve never really been able to find in any other language.
i don’t want to hear about rust, const generics are almost useless and you know it, specialization isn’t really a thing and nothing like variadic templates exists yet
i don’t want to hear about rust, const generics are almost useless and you know it, specialization isn’t really a thing and nothing like variadic templates exists yet
What is your honest opinion about Rust? I’m curious
Rust has a lot of cool ideas (I love the borrow checker), but in its current state I don’t think it can replace C++ for the things I’d be interested in using it for. 99% of the time when I reach for a natively compiled language it’s because I need to do some performance-critical loop I can’t reasonably implement in the language my business logic is written in (normally Java), and I end up in a situation where most of Rust’s advantages (and C++'s footguns) aren’t really relevant (lifetimes don’t matter if I’m just writing some SIMD code which reads/writes into externally allocated memory segments). So for my purposes, Rust is mostly just a worse version of C++ in that it’s missing a bunch of features I want (my main gripes already listed above) and has a bunch of cool features that I don’t care about.
If I were writing an entire program from scratch I’d probably opt for Rust over C++, at least for the bulk of the business logic, but I don’t think Rust has quite achieved its ideal of “zero-cost abstraction” for many performance-critical use cases, and certainly not most of the ones I actually have.
Ok thanks. Interesting to hear that. Rust does seem really cool but i someone wonder if I’m just caught up in a hype cycle. So it’s good to hear a well measured critique like this
This is probably an unpopular opinion, but I find modern C++ with templates and
constexprto be quite fun, mainly from the perspective of trying to do as much at compile-time as possible. Most of the resulting code is nearly incomprehensible and never gets used for anything outside of a godbolt demo, but trying to do complex tasks within the limited and unintuitive world of compile-time evaluation is something I’ve never really been able to find in any other language.i don’t want to hear about rust, const generics are almost useless and you know it, specialization isn’t really a thing and nothing like variadic templates exists yetWhat is your honest opinion about Rust? I’m curious
Rust has a lot of cool ideas (I love the borrow checker), but in its current state I don’t think it can replace C++ for the things I’d be interested in using it for. 99% of the time when I reach for a natively compiled language it’s because I need to do some performance-critical loop I can’t reasonably implement in the language my business logic is written in (normally Java), and I end up in a situation where most of Rust’s advantages (and C++'s footguns) aren’t really relevant (lifetimes don’t matter if I’m just writing some SIMD code which reads/writes into externally allocated memory segments). So for my purposes, Rust is mostly just a worse version of C++ in that it’s missing a bunch of features I want (my main gripes already listed above) and has a bunch of cool features that I don’t care about.
If I were writing an entire program from scratch I’d probably opt for Rust over C++, at least for the bulk of the business logic, but I don’t think Rust has quite achieved its ideal of “zero-cost abstraction” for many performance-critical use cases, and certainly not most of the ones I actually have.
Ok thanks. Interesting to hear that. Rust does seem really cool but i someone wonder if I’m just caught up in a hype cycle. So it’s good to hear a well measured critique like this
You should check out Zig’s macro system, I think you’ll find it really interesting.