Re:Rust on AVR: Safer microcontrollers almost here
by vertex-four on Sunday February 12, 2017 @09:58AM
(#13628597)
You can also get a buffer overflow in Python and Java by abusing their equivalents of "unsafe".
[ Parent
| on HN ]
Re:Rust on AVR: Safer microcontrollers almost here
by sidlls on Sunday February 12, 2017 @01:04PM
(#13629564)
"unsafe" in Rust isn't abuse. It's explicit syntax with compile time effects specifically for the purpose of facilitating unsafe constructs, like direct memory buffer manipulation, required for low level programming.
I've never tried the Python or Java equivalents and frankly don't know enough about them to even know whether your comment is accurate or not.
Re:Rust on AVR: Safer microcontrollers almost here
by vertex-four on Sunday February 12, 2017 @06:50PM
(#13631948)
Java has `sun.misc.Unsafe`, and Python has the FFI which is remarkably easy to misuse. The point is that you don't use these unless you need to, and you spend special effort when you do - same as `unsafe` in Rust. The rest of your code runs perfectly safely, and the vast majority of code has no need to use `unsafe`. Code which uses `unsafe` and isn't obviously either directly an FFI wrapper or a straightforward implementation of a generic data structure is generally considered bad form.