4 ms·
>The desire for stronger duck typing That's what C++ templates always have been, and got way, way tighter with concepts circa C++23. Rust's traits are also st
by romwell 2y ago
>The desire for stronger duck typing
That's what C++ templates always have been, and got way, way tighter with concepts circa C++23.
Rust's traits are also strong duck typing if you squint a little.
The idea in both cases is simple: write the algorithm first, figure outwhat can go into it later — which allows you to write the code as if all the parts have the types you need.
But then, have the compiler examine the ducks before the program runs, and if something doesn't quack, the compiler will.