Not to disagree with your post but this comes across as very black-and-white.
Not to disagree with your post but this comes across as very black-and-white.
There's a prioritized list of requirements in engineering. Use the right tool for the job.
Rust has: (see https://hackmd.io/@rust-ctcft/r1plN4You#/5 )
1. Safety
If you don't need that at the first slot, then the biggest strength of Rust doesn't apply to your problem (and you would waste time having to track lifetime parameters more than necessary to solve your problem).
The .clone() would have been [=] in C++, which would have safely quieted the warning.
To me, with the 20 years of experience I have in 8 programming languages, I'll always include safety. Especially having in mind that it's nearly zero-cost in terms of runtime performance.
So to me not choosing safety is a strong sign that I don't want to work with the people who practice that.
So, safety, good, fast enough, good, but insufficiently expressive? No, thank you.
Want to elaborate on that? Quite curious.
#[derive(Debug, PartialEq, Eq)]
pub struct ColumnVector<F, const DIM: usize>([F; DIM]);
impl<F: Field, const DIM: usize> Add<Self> for ColumnVector<F, DIM> {
type Output = ColumnVector<F, DIM>;
fn add(self, rhs: Self) -> Self::Output {
Self::new(self.0.zip(rhs.0).map(|(a,b)| a + b))
}
}
Usage: let v = ColumnVector::new([1.0,
3.0,
4.0]);
let w = ColumnVector::new([1.0,
0.0,
4.0]);
assert_eq!(v + w, ColumnVector::new([2.0,
3.0,
8.0]));I propose you start with genuinely concerning problems. Operator overloading is a first-world problem and I've made a good career never depending on it (outside of my active C/C++ years at the start of it).
"Generics argument concepts" says exactly nothing, to me at least. Elaborate?
"Programmed move semantics" is, if I understand you correctly, a flavor / taste thing but I can agree it can be made better and more explicit -- say by not using the `=` operator for it. That I could stand behind. Still, it's only catching you off-guard while you're learning. 50/50 though. It's a concern but IMO not a major one.
And your final sentence betrays bias to C++. Well fine, use that, nobody is forcing you to work with Rust, right?
But if you're willing to bash Rust, please do so with concrete arguments. If you know something negative about it that I don't, I believe I and many others will benefit from informed objective criticism.
Do you have that? Already asked you in another comment and I'm still willing to listen to it.