3 ms·
Is it memory-safe?
by cousin_it 11y ago
Is it memory-safe?
- portmanteaufu 11y agoFrom paragraph 3, emphasis mine: > Myrddin is not a language designed to explore the forefront of type theory or compiler technology. It is not a language that is focused on guaranteeing perfect safety. It is satisfied to be a practical, small, fairly well defined, and easy to understand language for code that needs to be close to the hardware. Memory safety is also absent from the 'Major features' list.
- kzhahou 11y agoDentist: Is it memory-safe? Hoffman: Is what memory-safe? Dentist: Is it memory-safe? Hoffman: I don't know what you mean. I can't tell you something's memory-safe or not, unless I know specifically what you're talking about. Dentist: Is it memory-safe? Hoffman: Tell me what the "it" refers to. Dentist: Is it memory-safe? Hoffman: Yes, it's memory-safe, it's very memory-safe, it's so memory-safe you wouldn't believe it. Dentist: Is it memory-safe? Hoffman: No. It's not memory-safe, it's... very dangerous, be careful. http://www.artvehicle.com/content/asides/AV-37-1228768613.jpg http://www.artvehicle.com/content/asides/AV-37-1228768613.jp...
- andrewchambers 11y agoit has bounds checking, everything uses slices, and you rarely need to use pointers so it is far safer than C, but not perfectly safe.
- ori_b 11y agoNo. It is memory dangerous. Please use appropriate personal protective equipment when using this, or you may find you have lost all memory of your family. More seriously: no, it makes no guarantees, but it tends to a much safer style by default: Bounds are checked, raw pointer arithmetic is ugly, clunky, and rarely used (although useful within, eg, the memory allocator), implicit conversions are gone, and null pointers aren't present in either the language or the library. You can define your own, even in a generic manner, but nothing uses this ability. Uninitialized variables are generally a compile time error (barring some bugs in the data flow analsyis), and so on. You can poke holes in the type system, but these holes are explicit. As a result, most code written is going to be far safer than, say, C.