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'm ambivalent about Rust these days.

I'm ambivalent about Rust these days.

Scheduled Pinned Locked Moved Uncategorized
39 Posts 11 Posters 147 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.
  • matt@toot.cafeM This user is from outside of this forum
    matt@toot.cafeM This user is from outside of this forum
    matt@toot.cafe
    wrote last edited by
    #20

    @inkreas.ing How long does a release build take?

    1 Reply Last reply
    0
    • matt@toot.cafeM matt@toot.cafe

      Were there other paths to a software stack with minimal unsafe code at the bottom that required far fewer machine resources to compile, that the industry chose not to take? Maybe the Rust Graydon wanted that had no future (https://graydon2.dreamwidth.org/307291.html)? I guess it's kind of moot, because the industry didn't take one of those paths, meaning there's no big library ecosystem on which to build, say, a new personal computing platform with a TTS/Braille-first UI framework.

      13/?

      matt@toot.cafeM This user is from outside of this forum
      matt@toot.cafeM This user is from outside of this forum
      matt@toot.cafe
      wrote last edited by
      #21

      OK, I guess Rust compile time isn't so bad on older computers that people actually use as personal computers. See this reply that came in from Bluesky. https://bsky.app/profile/did:plc:54jgbo4psy24qu2bk4njtpc4/post/3mlptu6oycc2g 5 seconds for a debug build on a 2009 MacBook. I feel better now.

      14/?

      matt@toot.cafeM 1 Reply Last reply
      0
      • matt@toot.cafeM This user is from outside of this forum
        matt@toot.cafeM This user is from outside of this forum
        matt@toot.cafe
        wrote last edited by
        #22

        @inkreas.ing What CPU model does that MacBook have? And how much RAM? Thanks.

        1 Reply Last reply
        0
        • matt@toot.cafeM matt@toot.cafe

          So, we could have a general-purpose personal computer that runs for 15 hours on a 2000 mAh battery. Maybe more with TTS output rather than a Braille display; I gather that Braille displays are fairly power-hungry because of all the pins moving up and down. But I believe that a general-purpose personal computer needs to be good for modifying its own software, at all levels of the stack. Rust fails hard on that criterion on this low-power CPU that has performance that used to be good.

          10/?

          E This user is from outside of this forum
          E This user is from outside of this forum
          edenlinnea@caneandable.social
          wrote last edited by
          #23

          @matt that's cool. I run primarily 100 percent with Braille unless Braille just won't read something.

          1 Reply Last reply
          0
          • matt@toot.cafeM matt@toot.cafe

            @swelljoe My first Linux box was a 486SX at 33 MHz in 1996. I think I put Linux on it when it still had only 4 MB of RAM. Hard to believe you could actually compile real C code, including the kernel, on that little.

            swelljoe@mas.toS This user is from outside of this forum
            swelljoe@mas.toS This user is from outside of this forum
            swelljoe@mas.to
            wrote last edited by
            #24

            @matt I had the Amiga C compiler Matt Dillon (of FreeBSD and Dragon BSD) made and I tinkered with it. I think I used it as far back as the Amiga 2000, which I think only had 1MB. I probably upgraded it in some way, but don't remember details, probably 2MB. The 3000 used weird ass ZIP RAM, and I distinctly remember I upgraded it to 8MB. But, I'm confident I wouldn't enjoy working with those kind of limitations for serious programming.

            1 Reply Last reply
            0
            • matt@toot.cafeM matt@toot.cafe

              OK, I guess Rust compile time isn't so bad on older computers that people actually use as personal computers. See this reply that came in from Bluesky. https://bsky.app/profile/did:plc:54jgbo4psy24qu2bk4njtpc4/post/3mlptu6oycc2g 5 seconds for a debug build on a 2009 MacBook. I feel better now.

              14/?

              matt@toot.cafeM This user is from outside of this forum
              matt@toot.cafeM This user is from outside of this forum
              matt@toot.cafe
              wrote last edited by
              #25

              Still, I can't help but wonder. Consider a counterfactual where the original ARM processor, the one that famously ran on about 100 mW (meaning that it could, by accident, run only on leakage current), had shipped in a personal computer that had been wildly successful, and it then became an industry norm that all personal computers going forward simply must use that little power. Where would we be now? Still writing large amounts of unsafe C code? Or would we have found a different path?

              15/?

              T C llogiq@hachyderm.ioL 3 Replies Last reply
              0
              • matt@toot.cafeM This user is from outside of this forum
                matt@toot.cafeM This user is from outside of this forum
                matt@toot.cafe
                wrote last edited by
                #26

                @inkreas.ing I gather that incremental build is a debug build? If so, do you find that, for a desktop application using an all-Rust GUI stack, the debug build is noticeably slower than the release build on that 2009 MacBook?

                1 Reply Last reply
                0
                • matt@toot.cafeM This user is from outside of this forum
                  matt@toot.cafeM This user is from outside of this forum
                  matt@toot.cafe
                  wrote last edited by
                  #27

                  @inkreas.ing Was Rust compilation in particular painful before you upgraded the RAM to 8 GB?

                  1 Reply Last reply
                  0
                  • matt@toot.cafeM This user is from outside of this forum
                    matt@toot.cafeM This user is from outside of this forum
                    matt@toot.cafe
                    wrote last edited by
                    #28

                    @inkreas.ing Ah, OK. Do you have LTO enabled in the release profile?

                    1 Reply Last reply
                    0
                    • matt@toot.cafeM This user is from outside of this forum
                      matt@toot.cafeM This user is from outside of this forum
                      matt@toot.cafe
                      wrote last edited by
                      #29

                      @inkreas.ing If you've got some time to kill, could you please run UnixBench (https://github.com/kdlucas/byte-unixbench) and post the results somewhere, maybe a gist? I know I might seem weirdly fixated on your anecdote, but yours is the oldest x86-based machine I've heard of so far that someone is using to develop an application in Rust, and I'd like to be able to compare it against other systems. Thanks!

                      1 Reply Last reply
                      0
                      • matt@toot.cafeM This user is from outside of this forum
                        matt@toot.cafeM This user is from outside of this forum
                        matt@toot.cafe
                        wrote last edited by
                        #30

                        @inkreas.ing Oh, I forgot that we had talked about this topic before.

                        1 Reply Last reply
                        0
                        • matt@toot.cafeM matt@toot.cafe

                          But, the Rust compiler is well-known for requiring significant computing power and memory. As just one recent anecdote, the prolific Hacker News commenter Thomas Ptacek recently mentioned that waiting for a Rust compile to finish was a factor in him deciding to comment on a controversial thread. And he was presumably running the Rust compiler on a high-end computer, the kind that we well-off software developers tend to use.

                          3/?

                          karolherbst@chaos.socialK This user is from outside of this forum
                          karolherbst@chaos.socialK This user is from outside of this forum
                          karolherbst@chaos.social
                          wrote last edited by
                          #31

                          @matt I _highly_ doubt those assessments, because huge C/C++ code bases will compile for longer in my experience.

                          I think it always depends on what you are comparing to here. Sure there are other languages that compile faster, because they don't rely on the LTO way of doing things, but especially C++ are not better in terms of compilation speed.

                          I even had people complain about rusticl compile times, but the C++ drivers just took way longer looking at the data.

                          karolherbst@chaos.socialK E 2 Replies Last reply
                          0
                          • karolherbst@chaos.socialK karolherbst@chaos.social

                            @matt I _highly_ doubt those assessments, because huge C/C++ code bases will compile for longer in my experience.

                            I think it always depends on what you are comparing to here. Sure there are other languages that compile faster, because they don't rely on the LTO way of doing things, but especially C++ are not better in terms of compilation speed.

                            I even had people complain about rusticl compile times, but the C++ drivers just took way longer looking at the data.

                            karolherbst@chaos.socialK This user is from outside of this forum
                            karolherbst@chaos.socialK This user is from outside of this forum
                            karolherbst@chaos.social
                            wrote last edited by
                            #32

                            @matt Though yes, the memory usage is bigger, so if you are memory constrainted you will run into issues.

                            But not sure there is a nice way out of this situation sadly...

                            1 Reply Last reply
                            0
                            • matt@toot.cafeM matt@toot.cafe

                              Still, I can't help but wonder. Consider a counterfactual where the original ARM processor, the one that famously ran on about 100 mW (meaning that it could, by accident, run only on leakage current), had shipped in a personal computer that had been wildly successful, and it then became an industry norm that all personal computers going forward simply must use that little power. Where would we be now? Still writing large amounts of unsafe C code? Or would we have found a different path?

                              15/?

                              T This user is from outside of this forum
                              T This user is from outside of this forum
                              thequinbox@dragonscave.space
                              wrote last edited by
                              #33

                              @matt THis is a really fascinating thread, I myself have been wondering lately what specifically makes rustc such a resource hog on those lower-power chips. Is it primarily the heavy lifting of proc-macros and crate expansion, or is the borrow checker's analysis just that computationally expensive? If the former, that seems like a problem that can be solved. If the latter, there are systems programming languages that compile way faster than Rust, see also Zig, but it doesn't provide the same safety features. It's not as unsafe as C, but you can still dereference null and get a crash.

                              1 Reply Last reply
                              0
                              • matt@toot.cafeM matt@toot.cafe

                                Still, I can't help but wonder. Consider a counterfactual where the original ARM processor, the one that famously ran on about 100 mW (meaning that it could, by accident, run only on leakage current), had shipped in a personal computer that had been wildly successful, and it then became an industry norm that all personal computers going forward simply must use that little power. Where would we be now? Still writing large amounts of unsafe C code? Or would we have found a different path?

                                15/?

                                C This user is from outside of this forum
                                C This user is from outside of this forum
                                clv1@mementomori.social
                                wrote last edited by
                                #34

                                @matt For making an user its own developer, the ideal is a language which need not compile and can be tested in real time, e.g. lisp and forth. Maybe something like they say about the 80s lisp machine, a machine programmed in a single language botton up and top down.

                                1 Reply Last reply
                                0
                                • matt@toot.cafeM matt@toot.cafe

                                  Still, I can't help but wonder. Consider a counterfactual where the original ARM processor, the one that famously ran on about 100 mW (meaning that it could, by accident, run only on leakage current), had shipped in a personal computer that had been wildly successful, and it then became an industry norm that all personal computers going forward simply must use that little power. Where would we be now? Still writing large amounts of unsafe C code? Or would we have found a different path?

                                  15/?

                                  llogiq@hachyderm.ioL This user is from outside of this forum
                                  llogiq@hachyderm.ioL This user is from outside of this forum
                                  llogiq@hachyderm.io
                                  wrote last edited by
                                  #35

                                  @matt just one data point here, while I immensely enjoy fast compilation times on a powerful machine, at one point I contributed to the Rust compiler on a Chromebook with 2 1.1GHz cores, 4G ram and 32G disk.

                                  I've mentored clippy contributors on android tablets with less than 4G RAM.

                                  So yes, while rustc won't ever be optimal in terms of compile time, it is absolutely possible to use it from less beefy machines. And often one can set up guardrails through types etc. so that compilation will stop at typeck (which is pretty quick) until the code is correct.

                                  1 Reply Last reply
                                  0
                                  • freya@social.highenergymagic.netF freya@social.highenergymagic.net

                                    @matt fuck no. look at the security features, onboard secure element and eFuses and such on some of them. I'm pretty sure that's an SoC that's covered by the CIP-LTS Linux kernel, which is what I plan to use in my device to avoid the "woops your bsp is no longer supported, fuck your updates" problem. specs I'm thinking. SAMA5D27 536MHz, 256MiB ram, 256MiB flash for OS, 4GB flash for apps and data. qwerty keyboard, D-pad, trackwheel, 2.8-inch 320x240 LCD. screenreader, obviously. custom UI layer because xorg and Wayland for this are both bad. the radio stack is SX1262 LoRa and MM8108 Wi-Fi HaLow, the former for device-to-device messaging, the latter for connection to a federated, independent, solar-powerable mesh mobile network I've been designing, based on Intel N100 base stations on lampposts and stuff. it initially started as "what if I make an accessible meshtastic device?" and expanded out to "what if we made an accessible, non-touchscreen, E2EE, federated smartphone platform, based on a mid 2000s blackberry formfactor, a device very good at making very secure communication very simple and reliable, and very not optimised for anything else?"

                                    matt@toot.cafeM This user is from outside of this forum
                                    matt@toot.cafeM This user is from outside of this forum
                                    matt@toot.cafe
                                    wrote last edited by
                                    #36

                                    @freya Is the power consumption of the SAMA5D27 a major factor in your choice of SoC?

                                    And, thank you for saying "screenreader, obviously". It's refreshing to hear about a project like this that aims to build in accessibility from the start.

                                    1 Reply Last reply
                                    0
                                    • karolherbst@chaos.socialK karolherbst@chaos.social

                                      @matt I _highly_ doubt those assessments, because huge C/C++ code bases will compile for longer in my experience.

                                      I think it always depends on what you are comparing to here. Sure there are other languages that compile faster, because they don't rely on the LTO way of doing things, but especially C++ are not better in terms of compilation speed.

                                      I even had people complain about rusticl compile times, but the C++ drivers just took way longer looking at the data.

                                      E This user is from outside of this forum
                                      E This user is from outside of this forum
                                      esoteric_programmer@social.stealthy.club
                                      wrote last edited by
                                      #37

                                      @karolherbst @matt yes, I remember trying to compile wxpython crashing my computer, meanwhile the odilia screenreader compiles just fine on it. The efficiency issues of rust analyzer though, O yeah, that I do feel, I can't develop on this 4 gigs of ram, 2 cores computer the same way I can compile on it, so I have to use another machine for development. The matrix sdk is similarly heavy, and most of that is either type monomorphisation, macros, cryptography code, or all of the above. Another issue is that I doubt our current accessibility stacks would fit properly, and work within, the limitations you're thinking of, the only reason that braille device can do so is because it has its own custom stack. Putting the at-spi registry daemon, dbus, speech dispatcher and modules on it, then orca too, most of your precious processing cycles would be spent on context switching, and in that form factor, that becomes important. So yeah, I think the premise one should start from there isn't necessarily rust vs C or zig, but rather optimizing the accessibility stack. Newton is a good step in the right direction, or maybe p2p at-spi for the more conservative apps, and then the screenreader will have to not use speech dispatcher, but load its own tts and access the sound devices directly. Well, perhaps pipewire is allowed there after all, we aren't desperate enough for performance to use raw alsa. But yeah, if we're to consider the ideal distance between developers and users as being you can modify your running OS, replace components on the fly and so on, then the real issue there is choosing a compiled language, and we should be using, idk, lisp or something, maybe python, and have most of the OS itself be written in that, except the small things which absolutely can't be done that way because of the hardware interactions.

                                      1 Reply Last reply
                                      0
                                      • freya@social.highenergymagic.netF freya@social.highenergymagic.net

                                        @matt fuck no. look at the security features, onboard secure element and eFuses and such on some of them. I'm pretty sure that's an SoC that's covered by the CIP-LTS Linux kernel, which is what I plan to use in my device to avoid the "woops your bsp is no longer supported, fuck your updates" problem. specs I'm thinking. SAMA5D27 536MHz, 256MiB ram, 256MiB flash for OS, 4GB flash for apps and data. qwerty keyboard, D-pad, trackwheel, 2.8-inch 320x240 LCD. screenreader, obviously. custom UI layer because xorg and Wayland for this are both bad. the radio stack is SX1262 LoRa and MM8108 Wi-Fi HaLow, the former for device-to-device messaging, the latter for connection to a federated, independent, solar-powerable mesh mobile network I've been designing, based on Intel N100 base stations on lampposts and stuff. it initially started as "what if I make an accessible meshtastic device?" and expanded out to "what if we made an accessible, non-touchscreen, E2EE, federated smartphone platform, based on a mid 2000s blackberry formfactor, a device very good at making very secure communication very simple and reliable, and very not optimised for anything else?"

                                        E This user is from outside of this forum
                                        E This user is from outside of this forum
                                        esoteric_programmer@social.stealthy.club
                                        wrote last edited by
                                        #38

                                        @freya @matt yo, that sounds goddamn awesome actually! however, I don't think you should go through the process of basically reinventing wayland, unless you want to rewrite all the things above it, which might be fine, but is also extremely time consuming in my view, it depends on what toolkit you're gonna use for the apps, how open would the platform be and stuff like that. I would recommend going with a minimal set of wayland protocols to get some apps to display, and then adding custom ones for the accessibility things wayland doesn't include, especially for that kind of device. Then, you can probably patch the toolkits for the apps you want to be available there to use those protocols where applicable, and there it goes, you only have to do half the work, not most of it 😛
                                        Also, solar powered mesh networks? holy shit, that's straight out of solarpunk sci-fi movies lol, that'd be even more awesome than the phone part in isolation

                                        1 Reply Last reply
                                        0
                                        • matt@toot.cafeM matt@toot.cafe

                                          As an example of the kind of processor I'm thinking of, consider the Microchip (formerly Atmel) SAMA5 family. Single-core Cortex-A5 at 500 MHz, benchmarking at 722 DMIPS on the evaluation board I recently ordered (yes, I've gone far down this rabbit hole), with 128 or 256 MB of RAM in typical configurations. The practicality of achieving 15 hours of battery life on a 2000 mAh battery has been directly validated by this SoC family's use in the HumanWare Mantis Q40 Braille display/note-taker.

                                          7/?

                                          stepheneb@ruby.socialS This user is from outside of this forum
                                          stepheneb@ruby.socialS This user is from outside of this forum
                                          stepheneb@ruby.social
                                          wrote last edited by
                                          #39

                                          @matt

                                          I had see what the “HumanWare Mantis Q40 Braille display/note-taker” was!

                                          https://store.humanware.com/hca/mantis-q40.html

                                          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