logoalt Hacker News

tialaramex11/08/20241 replyview on HN

I don't think Safe C++ has a Hindley-Milner type system? I think it's just the "Just the machine integers wearing funny hats†" types from C which were passed on to C++

In K&R C this very spartan type system makes some sense, there's no resources, you're on a tiny Unix machine, you'd otherwise be grateful for an assembler. In C++ it does look kinda silly, like an SUV with a lawnmower engine. Or one of those very complicated looking board games which turns out to just be Snakes and Ladders with more steps.

But I don't think Safe C++ fixes that anyhow.

† Technically maybe the C pointer types are not just the integers wearing a funny hat. That's one of many unresolved soundness bugs in the language, hence ISO/IEC DTS 6010 (which will some day become a TR)


Replies

whytevuhuni11/08/2024

No, Safe C++ does not have that type system. I was just trying to emphasize the amount of, let's be honest, downright genius that had to go into that lifetime specification and borrow checker implementation.

For C++, it'll be about cramming lifetimes into diamond-inheritance OOP, which... feels even harder.

Safe C sounds like a much, much more believable project, if such a proposal were to exist.