4 ms·
As I understand, in low-level languages the concept of ownership exists anyway, no matter whether the language allows to declare it explicitly or not. Rust just
by codedokode 4y ago
As I understand, in low-level languages the concept of ownership exists anyway, no matter whether the language allows to declare it explicitly or not. Rust just makes you write it out explicitly.
- ok123456 4y agoYes ownership exists, but the semantics of Rust's automatic ownership system are different as they're enforced as a linear type.
- tmtvl 4y agoThe only concept of ownership that exists in low level languages is that the kernel owns memory and gives your program a chunk of it. Aside from that I think the closest equivalent concept is the system break, but that just determines where in memory your stack and heap are divided.
- mtlmtlmtlmtl 4y agoOwnership doesn't exist in the C language per se, but it is still an important concept you have to reason about when manually managing memory. I think that's what GP meant. E.g if you add some object to a generic hash table as a key by pointer, you better treat that pointer as being owned by the hash table and not mutate it, or interesting stuff will happen.
- tmtvl 4y agoI mean sure, but we're not talking about C, we're talking about low-level languages, like IA32 assembly.
- mtlmtlmtlmtl 4y agoNo one uses "low level language" to mean only assembler anymore. Besides, you also have to reason about ownership in assembler. It's not something you can really get away from at any level of the stack.