Do you also argue that C++ is built on top of a crumbling foundation, because it's based on C, a ancient language with almost no type-safety?
Do you also argue that C++ is built on top of a crumbling foundation, because it's based on C, a ancient language with almost no type-safety?
It admittedly doesn't have a very advanced type system, that's true.
And typedefs. Given that there's no parametric types, you run into void* quite frequently as well, so saying "only" inaccurately minimizes the scale of how much C code isn't strictly type safe.
And may I ask why you say "typedef" is unsafe? It is merely a type alias, like e.g. Haskell's and ML's "type", or isn't it?
It is, but it freely allows conversion between the aliased types.
typedef int Feet;
typedef int Meters;
int main() {
Feet height = 6;
Meters inEngland = height; // <-- OK. :(
}λ> :{
Prelude| type Feet = Int
Prelude| type Metres = Int
Prelude| :}
λ> let a = 5 :: Feet
λ> let b = 4 :: Metres
λ> :t a
a :: Feet
λ> :t b
b :: Metres
λ> a + b
9
λ> let f = id :: Feet -> Feet
λ> f b
4
I do not think C is a "crumbling foundation". I would not suggest that C be used for large scale engineering efforts, but it's a relatively well-defined language with semantics dictated by a formal standard. A lot of research has gone into C compilers, which are state-of-the-art.
With that said, one of the biggest complaints I hear about C++ is that it still has the legacy of C embedded in it.