So let me be very clear: if you as a maintainer feel that you control who or what can use your code, YOU ARE WRONG.

  • @deur@feddit.nl
    link
    fedilink
    65
    edit-2
    5 months ago

    What the fuck is with the person in the email chain implying not all drivers can be written in Rust? Rust does literally everything C can, nothing stopping you from using unsafe properly to achieve that.

      • @barsoap@lemm.ee
        link
        fedilink
        11
        edit-2
        5 months ago

        That’s a performance optimisation which llvm is likely to do for you anyways, jump tables aren’t exactly rocket science. Gazing into my crystal ball, might have to turn your enum variant Foo(u8) with possible values 0…15 into Foo0 through Foo15 (or maybe better Foo(EnumWith16Variants)) so that the compiler doesn’t have to evaluate code to figure out that it doesn’t need to NOP the rest of the jump range out, or bail out of generating a jump table, whatever it would do.