Remix.run Logo
lallysingh 2 days ago

Call me stupid for asking, but what is "safe" here? I get the length-checked buffer copies and accesses, is there anything else? Less allowed type conversions?

MForster 2 days ago | parent | next [-]

You are talking about spatial safety. There are a few other types of memory safety:

- temporal safety (e.g. no use after free) - initialization safety (no read of initialized memory) - thread safety (no data races) - type safety (accessing memory with the correct type)

burakemir 2 days ago | parent | prev [-]

There is an old definition of language safety which means "no untrapped execution errors". It is not the only way to define safety, but it is a good way that you can adapt to various kinds of x-safety, such as memory safety.

I have a little post that explains this using a few more words, if interested: https://burakemir.ch/post/memory-safety-the-missing-def/