LQX Lemmy
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Sjmarf@sh.itjust.works to Programmer Humor@programming.dev · 1 year ago

Is this a Nut?

sh.itjust.works

message-square
13
link
fedilink
5

Is this a Nut?

sh.itjust.works

Sjmarf@sh.itjust.works to Programmer Humor@programming.dev · 1 year ago
message-square
13
link
fedilink
alert-triangle
You must log in or register to comment.
  • RonSijm@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    StackOverflow: Question closed as duplicate. Someone else already asked whether or not something is a nut.

  • muzzle@lemm.ee
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    1 year ago

    Rust is more like: unless you can mathematically prove to me that this is equivalent to a nut there is no ducking way I’ll ever let you compiled this.

    • CanadaPlus@lemmy.sdf.org
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      And hot take, but that’s good. I’m absolutely stupid enough for idiot gloves like that.

    • ryannathans@aussie.zone
      link
      fedilink
      arrow-up
      0
      arrow-down
      1
      ·
      edit-2
      1 year ago

      And then still segfault

      https://github.com/Speykious/cve-rs/blob/main/src/segfault.rs

      • EinfachUnersetzlich@lemm.ee
        link
        fedilink
        arrow-up
        0
        ·
        1 year ago

        If you can make safe Rust segfault you’re doing something wrong.

        • xlash123@sh.itjust.works
          link
          fedilink
          arrow-up
          1
          ·
          1 year ago

          It actually is possible to segfault in safe Rust, although it is considered a bug. Proofs of concept are shown in this cve-rs crate.

          If you want an explanation of why this happens, I recommend this video: https://youtu.be/vfMpIsJwpjU

        • 𝕽𝖚𝖆𝖎𝖉𝖍𝖗𝖎𝖌𝖍@midwest.social
          link
          fedilink
          arrow-up
          0
          arrow-down
          1
          ·
          1 year ago

          IME Rust programs crash at about the same rate as other languages. “Rewrite everything in Rust” hasn’t made much of a difference for me, so far.

          • nick@campfyre.nickwebster.dev
            link
            fedilink
            arrow-up
            1
            ·
            1 year ago

            A crash is different to a SEGFAULT. I’d be very surprised to see a safe rust program segfault unless it was actively exploiting a compiler bug.

  • AVincentInSpace@pawb.social
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    Java: “Sorry, but the developers of Peanut didn’t declare it to implement the Crackable interface, even though it has all the relevant methods, so if you want to treat it like a nut your choices are write a wrapper class or call those methods using Reflections”

    • Sjmarf@sh.itjust.worksOP
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      Swift’s extensions system has spoiled me, and I feel the pain of this whenever I have to write Java

      • AVincentInSpace@pawb.social
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        1 year ago

        Ditto, but Rust’s traits. God those are so fun. It’s like duck typing a la Python but you can just slap whatever methods you want on a foreign type without worrying about breaking anything because they’re only visible to the current crate (or other crates that import the Trait)

      • loutr@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        You should take a look at kotlin, pretty similar to swift and fully interoperable with java.

  • Cosmic Cleric@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    “What Java said.”

    Okay, that one made me chuckle.

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1.48K users / day
  • 5.5K users / week
  • 9.21K users / month
  • 17.8K users / 6 months
  • 1 local subscriber
  • 23.6K subscribers
  • 773 Posts
  • 15.3K Comments
  • Modlog
  • mods:
  • adr1an@programming.dev
  • Feyter@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.11
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org