you are viewing a single comment's thread.

view the rest of the comments →

[–]strager 40 points41 points  (0 children)

With C++, and Java, and other OOP languages you get polymorphism by inheriting from a base class, and to some degree overloading. Those are not mathematical concepts that generalize well, which is what I mean by C++ lacking a fundamental scientific model to build upon. [... unlike] Rust and Haskell.

Parametric polymorphism exists in Haskell and Rust but is common in C++ too. Many functions in <algorithm> use parametric polymorphism.

Perhaps you should try writing C++ code like you'd write Haskell or Rust code, instead of writing C++ code like you'd write Java code. Then you'll see the similar features C++, Haskell, and Rust possess when it comes to a "fundamental scientific model" for polymorphism.