3 ms·
I don't really agree, at least if the future looks like Rust. I much prefer C and I think an improved C can be memory safe even without GC.
by uecker 1y ago
I don't really agree, at least if the future looks like Rust. I much prefer C and I think an improved C can be memory safe even without GC.
- whytevuhuni 1y ago> 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?
- uecker 1y agoA 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.
- whytevuhuni 1y agoA C with lifetimes would be nice, I agree. Would be awesome if someone did a study to see if it's actually achievable... Cyclone's approach was certainly not enough, and I think some sort of generics or a Hindley-Milner type system might be required to get it to work, otherwise lifetimes would become completely unusable.
- uecker 1y agoYes, one needs polymorphism. Let's see. I have some ideas.
- 1718627440 1y agoC 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.
- uecker 1y agoWhat clashes?
- 1718627440 1y agoI think there was a discussion in the Linux kernel between a kernel maintainer and the Rust people, which started by the Rust people demanding formal semantics, so that they could encode it in Rust, and the subsystem maintainer unwilling to do that.
- uecker 1y agoAh, I thought you were talking about core language semantics in C.
- 1718627440 1y agoI don't know enough Rust, to do such a comparison.
- steveklabnik 1y ago“The rust people” were also kernel maintainers.
- 1718627440 1y agoSorry, I'm not familiar with the titles of kernel developers. I thought only one of them was the subsystem maintainer.
- steveklabnik 1y agoOne of them was a maintainer of that particular subsystem, but that doesn't mean that the other folks aren't also maintainers of other parts of the kernel.