« BackCursed Rustpaper.wfSubmitted by todsacerdoti 3 days ago
  • davidatbu 3 days ago

    I don't know if it's due to my familiarity with Rust, but I find none of the examples cursed or surprising, except the "&* is useful" one. Even for that one, I think the use case of "turning a raw pointer to a reference" actually requires unsafe, and so it's imo a bit misleading to omit that fact.

    All this is unlike a language i work with in my day job (and hence one would expect that I'd not find surprising), and yet I find so much behavior utterly baffling: https://dev.to/ben/what-is-the-oddest-javascript-behavior-4d...

    • ramon156 3 days ago

      I guess the "cursed" part is that developers can make unexpected behavior happen, but what's the point? No one's gonna purposefully make a bad clone/copy.

      • davidatbu 2 days ago

        ¯\_(ツ)_/¯

    • dabacaba 3 days ago

      In Rust, if expressions are not place expressions. In the example, arr_ref is a reference to a temporary, not to an array element. In Rust, it is possible to take an address of any expression, but taking an address of a value expression will produce an address of a temporary.

    • atoav 3 days ago

      #00F on black is really not a color combination anybody should use in any case where accessability matters.

      • desdenova 2 days ago

        Cursed article by someone who doesn't know Rust.

        • undefined 2 days ago
          [deleted]