3 ms·
> Another real-life example is the “unsafe” mode some statically-typed languages have, which effectively switches to a laxer type system. Are you referring to
by zokier 3y ago
> Another real-life example is the “unsafe” mode some statically-typed languages have, which effectively switches to a laxer type system.
Are you referring to Rust here? Because I believe unsafe there doesn't change type checking or type system in any way
- layer8 3y ago“Unsafe” disables borrow checking in Rust, which is part of the type system. C# also has a (different) “unsafe”.
- neonsunset 3y agoConceptually speaking they are quite close: both let you write code C-style with raw pointers within unsafe blocks. Similar to Rust, C# also has a subset of Unsafe and Marshal APIs which explicitly indicate their risk for bypassing compiler or language checks when either you know what you are doing or when whatever goal they achieve is not expressible with safe code.
- remexre 3y agounsafe does not disable the borrow checker, it allows calling functions that could not be otherwise written in code that is OK'd by the borrow checker.