logoalt Hacker News

whytevuhuniyesterday at 6:32 PM2 repliesview on HN

> I think an improved C can be memory safe even without GC

That's a very interesting belief. Do you see a way to achieve temporal memory safety without a GC, and I assume also without lifetimes?


Replies

ueckeryesterday at 7:07 PM

A simple pointer ownership model can achieve temporal memory safety, but I think to be convenient to use we may need lifetimes. I see no reason this could not be added to C.

show 1 reply
1718627440yesterday at 11:58 PM

C does have the concept of lifetimes. There is just no syntax to specify it, so it is generally described along all the other semantic details of the API. And no it is not the same as for Rust, which causes clashes with the Rust people.