Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Cyborg)
  • No Skin
Collapse
Brand Logo

CIRCLE WITH A DOT

  1. Home
  2. Uncategorized
  3. I am NOT making a Rust replacement, but — if you could fix one* thing about Rust syntax/semantics/etc.

I am NOT making a Rust replacement, but — if you could fix one* thing about Rust syntax/semantics/etc.

Scheduled Pinned Locked Moved Uncategorized
120 Posts 48 Posters 160 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • poliorcetics@social.treehouse.systemsP poliorcetics@social.treehouse.systems

    @cyberia @fasterthanlime IIRC this has been an accepted rfc for a long time and nobody has implemented it. Or maybe it was just about unions ?

    yosh@toot.yosh.isY This user is from outside of this forum
    yosh@toot.yosh.isY This user is from outside of this forum
    yosh@toot.yosh.is
    wrote last edited by
    #17

    @poliorcetics @cyberia @fasterthanlime

    Tuples are anonymous structs. To my knowledge anonymous enums have not been accepted; I agree they would be nice.

    poliorcetics@social.treehouse.systemsP simon@tutut.delire.partyS 2 Replies Last reply
    0
    • fasterthanlime@hachyderm.ioF fasterthanlime@hachyderm.io

      I am NOT making a Rust replacement, but — if you could fix one* thing about Rust syntax/semantics/etc. what would you fix?

      (*one per reply, multiple replies per household are allowed)

      yosh@toot.yosh.isY This user is from outside of this forum
      yosh@toot.yosh.isY This user is from outside of this forum
      yosh@toot.yosh.is
      wrote last edited by
      #18

      @fasterthanlime

      The things I would fix about Rust are the things I am working on hah.

      If I could wave a wand tho I'd probably use it to fix the Iterator and Future traits. Not because they are impossible to fix now, but doing that now will be incredibly tedious work.

      1 Reply Last reply
      0
      • fasterthanlime@hachyderm.ioF fasterthanlime@hachyderm.io

        I am NOT making a Rust replacement, but — if you could fix one* thing about Rust syntax/semantics/etc. what would you fix?

        (*one per reply, multiple replies per household are allowed)

        chosunone@pleroma.chosunone.ioC This user is from outside of this forum
        chosunone@pleroma.chosunone.ioC This user is from outside of this forum
        chosunone@pleroma.chosunone.io
        wrote last edited by
        #19
        @fasterthanlime Proper generator syntax
        1 Reply Last reply
        0
        • fasterthanlime@hachyderm.ioF fasterthanlime@hachyderm.io

          I am NOT making a Rust replacement, but — if you could fix one* thing about Rust syntax/semantics/etc. what would you fix?

          (*one per reply, multiple replies per household are allowed)

          chosunone@pleroma.chosunone.ioC This user is from outside of this forum
          chosunone@pleroma.chosunone.ioC This user is from outside of this forum
          chosunone@pleroma.chosunone.io
          wrote last edited by
          #20
          @fasterthanlime Marking fields as mutable on a struct, immutable by default
          fasterthanlime@hachyderm.ioF 1 Reply Last reply
          0
          • fasterthanlime@hachyderm.ioF fasterthanlime@hachyderm.io

            I am NOT making a Rust replacement, but — if you could fix one* thing about Rust syntax/semantics/etc. what would you fix?

            (*one per reply, multiple replies per household are allowed)

            tribaal@hachyderm.ioT This user is from outside of this forum
            tribaal@hachyderm.ioT This user is from outside of this forum
            tribaal@hachyderm.io
            wrote last edited by
            #21

            @fasterthanlime I think I’d just make tokio part of the standard and avoid the async function colouring problem. Then spend time on the compiler to be smart about the actually necessary async inclusion vs compiling to sync

            soc@chaos.socialS 1 Reply Last reply
            0
            • fasterthanlime@hachyderm.ioF This user is from outside of this forum
              fasterthanlime@hachyderm.ioF This user is from outside of this forum
              fasterthanlime@hachyderm.io
              wrote last edited by
              #22

              @arichtman @yosh This is going to be a very, very, very, very long thread.

              1 Reply Last reply
              0
              • chosunone@pleroma.chosunone.ioC chosunone@pleroma.chosunone.io
                @fasterthanlime Marking fields as mutable on a struct, immutable by default
                fasterthanlime@hachyderm.ioF This user is from outside of this forum
                fasterthanlime@hachyderm.ioF This user is from outside of this forum
                fasterthanlime@hachyderm.io
                wrote last edited by
                #23

                @chosunone So you want mutability of fields to be controlled at declaration site and not binding site. What's the... Can you give me a for instance?

                chosunone@pleroma.chosunone.ioC 1 Reply Last reply
                0
                • fasterthanlime@hachyderm.ioF fasterthanlime@hachyderm.io

                  I am NOT making a Rust replacement, but — if you could fix one* thing about Rust syntax/semantics/etc. what would you fix?

                  (*one per reply, multiple replies per household are allowed)

                  lutzky@ohai.socialL This user is from outside of this forum
                  lutzky@ohai.socialL This user is from outside of this forum
                  lutzky@ohai.social
                  wrote last edited by
                  #24

                  @fasterthanlime support a "slow but correct" mode. Rust's tradeoff is "fight the compiler hard, but resulting code is fast and correct". I'd like an option for "less compiler fighting, slower is OK, less correct is not OK". Something like "implicitly wrap all my shit with garbage collection". I'd like Go-level performance with rust-level correctness.

                  samir@mastodon.functional.computerS lutzky@ohai.socialL 2 Replies Last reply
                  0
                  • fasterthanlime@hachyderm.ioF fasterthanlime@hachyderm.io

                    I am NOT making a Rust replacement, but — if you could fix one* thing about Rust syntax/semantics/etc. what would you fix?

                    (*one per reply, multiple replies per household are allowed)

                    chosunone@pleroma.chosunone.ioC This user is from outside of this forum
                    chosunone@pleroma.chosunone.ioC This user is from outside of this forum
                    chosunone@pleroma.chosunone.io
                    wrote last edited by
                    #25
                    @fasterthanlime lots of syntax sugar for pinned things
                    1 Reply Last reply
                    0
                    • yosh@toot.yosh.isY yosh@toot.yosh.is

                      @poliorcetics @cyberia @fasterthanlime

                      Tuples are anonymous structs. To my knowledge anonymous enums have not been accepted; I agree they would be nice.

                      poliorcetics@social.treehouse.systemsP This user is from outside of this forum
                      poliorcetics@social.treehouse.systemsP This user is from outside of this forum
                      poliorcetics@social.treehouse.systems
                      wrote last edited by
                      #26

                      @yosh @cyberia @fasterthanlime tuple are a sad replacement for what C allows for example.

                      Found the rust rfc, 2102

                      1 Reply Last reply
                      0
                      • fasterthanlime@hachyderm.ioF fasterthanlime@hachyderm.io

                        @chosunone So you want mutability of fields to be controlled at declaration site and not binding site. What's the... Can you give me a for instance?

                        chosunone@pleroma.chosunone.ioC This user is from outside of this forum
                        chosunone@pleroma.chosunone.ioC This user is from outside of this forum
                        chosunone@pleroma.chosunone.io
                        wrote last edited by
                        #27
                        @fasterthanlime When I borrow `self` mutably, it ends up locking down the entire self from immutable borrows, but really I just want certain fields to be locked down. Some fields will never be mutably borrowed and so I should allow immutable borrows to self that only access those fields. Basically in the direction of field projection.
                        ianthetechie@fosstodon.orgI 1 Reply Last reply
                        0
                        • chebra@mstdn.ioC chebra@mstdn.io

                          @fasterthanlime Redeclaring a variable of the same name should be an error.

                          aru@hachyderm.ioA This user is from outside of this forum
                          aru@hachyderm.ioA This user is from outside of this forum
                          aru@hachyderm.io
                          wrote last edited by
                          #28

                          @chebra @fasterthanlime in case you're not already aware (and haven't found this to be insufficient), Clippy has the shadow_* family of lints that address this.

                          chebra@mstdn.ioC 1 Reply Last reply
                          0
                          • fasterthanlime@hachyderm.ioF fasterthanlime@hachyderm.io

                            @lizzy what properties would the remake have?

                            lizzy@social.vlhl.devL This user is from outside of this forum
                            lizzy@social.vlhl.devL This user is from outside of this forum
                            lizzy@social.vlhl.dev
                            wrote last edited by
                            #29
                            @fasterthanlime it should allow distros to package crates separately (even if they are ultimately statically linked together), shouldn't force download at build time (many distros network-sandbox their build environment). the only way to do this currently is downloading the crates ahead of time, running a checksum and then adding a fake repository locally to overwrite crates.io. it should also be able to allow specifying external C dependencies properly because crates vendoring C code is hell for packagers. it should be less reliant on lockfiles and the ecosystem should ideally have less 0.x packages and less very small trivial creates like is_docker that bloat the dependency graph.

                            cargo obviously is quite convenient for upstream devs because it becomes very easy to add dependencies and so on, and for the most part, cargo could still function similarly for developers but also be more aware of distribution models that aren't "just vendor everything by downloading it from a centralized repository at build time". meson using subprojects and wrapfiles shows how a good compromise could work.

                            as is a lot of packagers and distro people have zero enthusiasm for rust because it essentially makes their life hell (hence also creating opposition to something like the python cryptography rewrite in rust), and I think that is quite sad because Rust as a language has a lot useful features for developers.
                            fasterthanlime@hachyderm.ioF lizzy@social.vlhl.devL 2 Replies Last reply
                            0
                            • lizzy@social.vlhl.devL lizzy@social.vlhl.dev
                              @fasterthanlime it should allow distros to package crates separately (even if they are ultimately statically linked together), shouldn't force download at build time (many distros network-sandbox their build environment). the only way to do this currently is downloading the crates ahead of time, running a checksum and then adding a fake repository locally to overwrite crates.io. it should also be able to allow specifying external C dependencies properly because crates vendoring C code is hell for packagers. it should be less reliant on lockfiles and the ecosystem should ideally have less 0.x packages and less very small trivial creates like is_docker that bloat the dependency graph.

                              cargo obviously is quite convenient for upstream devs because it becomes very easy to add dependencies and so on, and for the most part, cargo could still function similarly for developers but also be more aware of distribution models that aren't "just vendor everything by downloading it from a centralized repository at build time". meson using subprojects and wrapfiles shows how a good compromise could work.

                              as is a lot of packagers and distro people have zero enthusiasm for rust because it essentially makes their life hell (hence also creating opposition to something like the python cryptography rewrite in rust), and I think that is quite sad because Rust as a language has a lot useful features for developers.
                              fasterthanlime@hachyderm.ioF This user is from outside of this forum
                              fasterthanlime@hachyderm.ioF This user is from outside of this forum
                              fasterthanlime@hachyderm.io
                              wrote last edited by
                              #30

                              @lizzy Okay, I see where you're coming from. Unfortunately, it covers a lot more ground than just cargo, but yeah.

                              1 Reply Last reply
                              0
                              • lizzy@social.vlhl.devL lizzy@social.vlhl.dev
                                @fasterthanlime it should allow distros to package crates separately (even if they are ultimately statically linked together), shouldn't force download at build time (many distros network-sandbox their build environment). the only way to do this currently is downloading the crates ahead of time, running a checksum and then adding a fake repository locally to overwrite crates.io. it should also be able to allow specifying external C dependencies properly because crates vendoring C code is hell for packagers. it should be less reliant on lockfiles and the ecosystem should ideally have less 0.x packages and less very small trivial creates like is_docker that bloat the dependency graph.

                                cargo obviously is quite convenient for upstream devs because it becomes very easy to add dependencies and so on, and for the most part, cargo could still function similarly for developers but also be more aware of distribution models that aren't "just vendor everything by downloading it from a centralized repository at build time". meson using subprojects and wrapfiles shows how a good compromise could work.

                                as is a lot of packagers and distro people have zero enthusiasm for rust because it essentially makes their life hell (hence also creating opposition to something like the python cryptography rewrite in rust), and I think that is quite sad because Rust as a language has a lot useful features for developers.
                                lizzy@social.vlhl.devL This user is from outside of this forum
                                lizzy@social.vlhl.devL This user is from outside of this forum
                                lizzy@social.vlhl.dev
                                wrote last edited by
                                #31
                                @fasterthanlime by the way, ironically, distros are also facing issues with security caused by rust, because if there is a vulnerability found in one crate, they can't simply bump that crate (and potentially trigger a rebuild for all its dependencies), but instead they either have to wait for upstream devs to update their lockfiles or individually patch every single lockfile in every single project and make sure that it still works etc.
                                1 Reply Last reply
                                0
                                • fasterthanlime@hachyderm.ioF fasterthanlime@hachyderm.io

                                  I am NOT making a Rust replacement, but — if you could fix one* thing about Rust syntax/semantics/etc. what would you fix?

                                  (*one per reply, multiple replies per household are allowed)

                                  chosunone@pleroma.chosunone.ioC This user is from outside of this forum
                                  chosunone@pleroma.chosunone.ioC This user is from outside of this forum
                                  chosunone@pleroma.chosunone.io
                                  wrote last edited by
                                  #32
                                  @fasterthanlime I'm not sure what the right solution is, but self references that "move" with the struct. So if you move a struct, any self references get updated. Maybe a non-trivial runtime penalty, but just make it possible. I don't like reinventing pointers for referencing items in a collection I own.
                                  pierrelebeaupin@mastodon.gougere.frP 1 Reply Last reply
                                  0
                                  • aru@hachyderm.ioA aru@hachyderm.io

                                    @chebra @fasterthanlime in case you're not already aware (and haven't found this to be insufficient), Clippy has the shadow_* family of lints that address this.

                                    chebra@mstdn.ioC This user is from outside of this forum
                                    chebra@mstdn.ioC This user is from outside of this forum
                                    chebra@mstdn.io
                                    wrote last edited by
                                    #33

                                    @aru Thanks, didn't know, that sounds like it could be enough for me.

                                    1 Reply Last reply
                                    0
                                    • fasterthanlime@hachyderm.ioF fasterthanlime@hachyderm.io

                                      I am NOT making a Rust replacement, but — if you could fix one* thing about Rust syntax/semantics/etc. what would you fix?

                                      (*one per reply, multiple replies per household are allowed)

                                      fasterthanlime@hachyderm.ioF This user is from outside of this forum
                                      fasterthanlime@hachyderm.ioF This user is from outside of this forum
                                      fasterthanlime@hachyderm.io
                                      wrote last edited by
                                      #34

                                      I think I may have accidentally come up with a drinking game

                                      If someone mentions function coloring, you have to finish your glass

                                      fasterthanlime@hachyderm.ioF sdowney@mastodon.socialS graydon@types.plG 3 Replies Last reply
                                      0
                                      • fasterthanlime@hachyderm.ioF fasterthanlime@hachyderm.io

                                        I am NOT making a Rust replacement, but — if you could fix one* thing about Rust syntax/semantics/etc. what would you fix?

                                        (*one per reply, multiple replies per household are allowed)

                                        samir@mastodon.functional.computerS This user is from outside of this forum
                                        samir@mastodon.functional.computerS This user is from outside of this forum
                                        samir@mastodon.functional.computer
                                        wrote last edited by
                                        #35

                                        @fasterthanlime Better handling of & so I don’t ever have to call .as_ref(), and similar syntax for impl AsRef<Thing> so I don’t have to care about whether it’s an Rc or an Arc or whatever.

                                        1 Reply Last reply
                                        0
                                        • fasterthanlime@hachyderm.ioF fasterthanlime@hachyderm.io

                                          I am NOT making a Rust replacement, but — if you could fix one* thing about Rust syntax/semantics/etc. what would you fix?

                                          (*one per reply, multiple replies per household are allowed)

                                          samir@mastodon.functional.computerS This user is from outside of this forum
                                          samir@mastodon.functional.computerS This user is from outside of this forum
                                          samir@mastodon.functional.computer
                                          wrote last edited by
                                          #36

                                          @fasterthanlime Future should be a wrapper around Pin<Box<dyn FutureImpl>>. It would cost almost nothing and make a lot of async stuff way easier.

                                          (Bonus points if Pin goes away entirely. The wrapper also wins because if we do get a better way to handle pinning, it could be removed in an edition upgrade.)

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups