• FizzyOrange@programming.dev
    link
    fedilink
    arrow-up
    3
    ·
    7 hours ago

    There are definitely some cases where memory safety isn’t especially important:

    • Single player games
    • Apps that don’t process external data (e.g. a simple calculator).
    • Lots of things running on microcontrollers, where the form of input could never possibly cause any security issues. E.g. a motor controller or a basic syringe pump or a (non-smart) washing machine or something.
    • Tests, e.g. I’ve considered writing RISC-V tests in Zig. They’re traditionally written in C or assembly.

    In cases like those, memory unsafety mainly leads to non-security bugs and annoying debugging sessions. But I wouldn’t say it’s as much of a deal breaker compared to e.g. writing a video codec or font renderer or web browser or DNS server or whatever.

    I still think Rust is a better choice than Zig in most cases anyway, even ignoring memory safety. But in these cases it’s at least a defensible choice.