Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • 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 (No Skin)
  • No Skin
Collapse
Brand Logo

agnos.is Forums

  1. Home
  2. Technology
  3. Rust is Eating JavaScript

Rust is Eating JavaScript

Scheduled Pinned Locked Moved Technology
technology
101 Posts 54 Posters 894 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.
  • V [email protected]
    This post did not contain any content.
    V This user is from outside of this forum
    V This user is from outside of this forum
    [email protected]
    wrote on last edited by
    #45

    Because corporations doesn't want web to be open, everyone can javascript, not everyone can read webassembly.

    dark_arc@social.packetloss.ggD 1 Reply Last reply
    0
    • V [email protected]
      This post did not contain any content.
      W This user is from outside of this forum
      W This user is from outside of this forum
      [email protected]
      wrote on last edited by
      #46

      Is this a 2yo write up, considering the last update was in 2023?

      M Z 2 Replies Last reply
      0
      • kolanaki@pawb.socialK [email protected]

        That means eventually everything tastes great when smothered in butter. 🤤

        M This user is from outside of this forum
        M This user is from outside of this forum
        [email protected]
        wrote on last edited by
        #47

        Eventually?

        1 Reply Last reply
        0
        • V [email protected]

          Because corporations doesn't want web to be open, everyone can javascript, not everyone can read webassembly.

          dark_arc@social.packetloss.ggD This user is from outside of this forum
          dark_arc@social.packetloss.ggD This user is from outside of this forum
          [email protected]
          wrote on last edited by
          #48

          The minifiers have long made JavaScript just as indecipherable

          0 V 2 Replies Last reply
          0
          • Q [email protected]

            I usually pick Rust for CLI tools because:

            1. It's statically compiled and isn't dependent on system binaries and won't break if there if the system has the wrong version like C/C++, allowing you to distribute it as a single binary without any other installation steps
            2. Still produces fairly small binaries unlike languages like Java or C# (because of the VM)
            3. Is a modern language with a good build system (It's like night and day compared to CMake)
            4. And I just like how the language works (errors as values etc.)
            dark_arc@social.packetloss.ggD This user is from outside of this forum
            dark_arc@social.packetloss.ggD This user is from outside of this forum
            [email protected]
            wrote on last edited by
            #49
            1. It's statically compiled and isn't dependent on system binaries and won't break if there if the system has the wrong version like C/C++, allowing you to distribute it as a single binary without any other installation steps

            You can do that with C++ too.

            1. Still produces fairly small binaries unlike languages like Java or C# (because of the VM)

            I mean, the jars are actually pretty small; but also I really don't get the storage argument. I mean we live in a world where people happily download a 600 MB discord client.

            1. Is a modern language with a good build system (It's like night and day compared to CMake)

            Meson exists ... as do others.

            1. And I just like how the language works (errors as values etc.)

            Fair enough; though why? What's wrong with exceptions?

            I work in a code base where I can't use exceptions because certain customers can't use exceptions, and I regularly wish I could because errors as values is so tedious.

            zykino@programming.devZ 1 Reply Last reply
            0
            • V [email protected]
              This post did not contain any content.
              V This user is from outside of this forum
              V This user is from outside of this forum
              [email protected]
              wrote on last edited by
              #50

              Can browsers run rust in the front end instead of javascript, or is it limited to transpile time and backend?

              S 1 Reply Last reply
              0
              • V [email protected]

                Can browsers run rust in the front end instead of javascript, or is it limited to transpile time and backend?

                S This user is from outside of this forum
                S This user is from outside of this forum
                [email protected]
                wrote on last edited by
                #51

                Sort of, browsers can run rust code through webassembly. But i dont think this is a full replacement for JavaScript as of yet.

                S 1 Reply Last reply
                0
                • dark_arc@social.packetloss.ggD [email protected]

                  The minifiers have long made JavaScript just as indecipherable

                  0 This user is from outside of this forum
                  0 This user is from outside of this forum
                  [email protected]
                  wrote on last edited by
                  #52

                  You can deminify, decompiling is a bit harder.

                  1 Reply Last reply
                  0
                  • T [email protected]

                    Has Golang fizzled? It has struck me as too primitive, but basically on the right track.

                    My biggest issue with Golang by far is the close tie to Google. They are not our friendly innovator, time and time again they make decisions that will help them earn more ad money, and nothing else. And they have a lobg history of releasing something and then never fix the issues with it, and then more or less abandon it.

                    Other than that there are afaik some other issues with go, I'm not an expert but from what I hear the GC is quite aggressive and you can't tell it to run when you want. Doing something time sensitive? Well, bad luck. GC time!

                    0 This user is from outside of this forum
                    0 This user is from outside of this forum
                    [email protected]
                    wrote on last edited by
                    #53

                    the close tie to Google.

                    Guess who's one of the rounders of the Rust Foundation...

                    1 Reply Last reply
                    0
                    • S [email protected]

                      Sort of, browsers can run rust code through webassembly. But i dont think this is a full replacement for JavaScript as of yet.

                      S This user is from outside of this forum
                      S This user is from outside of this forum
                      [email protected]
                      wrote on last edited by
                      #54

                      Yeah, you need to have some JS to manipulate graphics, so the Rust web frameworks have a JS shim to do that and communicate with the WebAssembly Rust code as necessary. It works surprisingly well tho.

                      S 1 Reply Last reply
                      0
                      • B [email protected]

                        Fun fact! Lemmy is made in Rust!

                        S This user is from outside of this forum
                        S This user is from outside of this forum
                        [email protected]
                        wrote on last edited by
                        #55

                        The BE, yes, the FE is JS.

                        B 1 Reply Last reply
                        0
                        • M [email protected]

                          I thought python has kinda exploded lately...

                          S This user is from outside of this forum
                          S This user is from outside of this forum
                          [email protected]
                          wrote on last edited by
                          #56

                          I use it at work, and it's finally getting an optimization pass.

                          I wish I did Rust for work, but options are limited and I like my team. So I use it for hobbies until I have a reason to leave.

                          M 1 Reply Last reply
                          0
                          • kolanaki@pawb.socialK [email protected]

                            That means eventually everything tastes great when smothered in butter. 🤤

                            S This user is from outside of this forum
                            S This user is from outside of this forum
                            [email protected]
                            wrote on last edited by
                            #57

                            That's why French food is world renounced, it has copious amounts of butter.

                            1 Reply Last reply
                            0
                            • P [email protected]

                              I think there's room for a rust-lite language that is GCed. Something with a functional-style type system and that compiles to machine code.

                              Roc is a candidate for this language. Basically Elm that compiles to machine code, but with a number of tweaks to make it work for more than just a web front end. Like Elm, the type system is haskell like, but simplified.

                              S This user is from outside of this forum
                              S This user is from outside of this forum
                              [email protected]
                              wrote on last edited by
                              #58

                              Sounds kinda like Go. It's not functional, but functional patterns work well there.

                              It's not great for FE though.

                              P 1 Reply Last reply
                              0
                              • T [email protected]

                                Has Golang fizzled? It has struck me as too primitive, but basically on the right track.

                                My biggest issue with Golang by far is the close tie to Google. They are not our friendly innovator, time and time again they make decisions that will help them earn more ad money, and nothing else. And they have a lobg history of releasing something and then never fix the issues with it, and then more or less abandon it.

                                Other than that there are afaik some other issues with go, I'm not an expert but from what I hear the GC is quite aggressive and you can't tell it to run when you want. Doing something time sensitive? Well, bad luck. GC time!

                                S This user is from outside of this forum
                                S This user is from outside of this forum
                                [email protected]
                                wrote on last edited by
                                #59

                                The GC in Go is fantastic IMO since it runs in a separate thread. I used it since 1.0 (switched our product from node.js), and dealt with all the the pain of an imprecise GC (fixed in 1.5?) and all the little improvements to arrive at it's current state.

                                The main issues I have with it are pretty core to the language, unfortunately, such as:

                                • interface{} is basically a void*, but since it's a fat pointer, it can hold nil without itself being nil, which can happen by accident
                                • runtime reflection is a bad habit, but it's unfortunately really common
                                • it's really easy to deadlock by making stupid mistakes; if it had automatic unlocking based on scope (like Rust, or something like Python's context managers), we could solve this, but defer just isn't good enough
                                • no destructors - with destructors, we could build a solution to deadlocks

                                Maybe they fixed some of those issues, idk, I haven't used it for several years. I did use it for about 10 years though.

                                O 1 Reply Last reply
                                0
                                • S [email protected]

                                  The JS tooling universe has always seemed like a Lovecraftian hellscape to me. I've managed to stay away from it so far, but if I were caught in it, of course I'd be trying to escape any way I could. It sounds like Rust's attraction here has been as a viable escape corridor rather than anything about Rust per se.

                                  In particular, I get that everyone wants their code to be faster, and I get that certain bloaty apps (browsers) need to get their memory footprint under control, and a few niche areas (OS kernels, realtime control) can't stand GC pauses. Other than that though, what is the attraction of Rust for stuff like tooling? As opposed to a (maybe hypothetical) compiled, GC'd language with a good type system and not too much abstraction inversion (Haskell's weakness, more or less).

                                  Has Golang fizzled? It has struck me as too primitive, but basically on the right track.

                                  Rust seems neat from a language geek perspective, but from what I can tell, it requires considerable effort from the programmer handle a problem (manual storage reclamation) that most programs don't really have. I do want to try it sometime. So this post is intended as more inquisitive/head scratching rather than argumentative.

                                  S This user is from outside of this forum
                                  S This user is from outside of this forum
                                  [email protected]
                                  wrote on last edited by
                                  #60

                                  Go is fine, but it has its flaws. I prefer Rust because:

                                  • memory safety is a compiler check, not a runtime check, so you catch issues earlier
                                  • locks contain their values, so you can't accidentally do anything unsafe
                                  • no nil (() is semantically different), so no surprises with contracts
                                  • everything is an expression, which lends itself really well to FP concepts
                                  • actual dependency management at 1.0
                                  • pretty much no runtime, so calling from another language is super easy
                                  • targets WASM and microcontrollers
                                  • no pointers (not exactly true)

                                  It takes longer to learn, but I'm about as productive with both now.

                                  S 1 Reply Last reply
                                  0
                                  • S [email protected]

                                    Sounds kinda like Go. It's not functional, but functional patterns work well there.

                                    It's not great for FE though.

                                    P This user is from outside of this forum
                                    P This user is from outside of this forum
                                    [email protected]
                                    wrote on last edited by
                                    #61

                                    What's FE?

                                    S 1 Reply Last reply
                                    0
                                    • V [email protected]
                                      This post did not contain any content.
                                      icastfist@programming.devI This user is from outside of this forum
                                      icastfist@programming.devI This user is from outside of this forum
                                      [email protected]
                                      wrote on last edited by
                                      #62

                                      Can we please go back to making programs for the target OS and skip the browser dependency?

                                      T W jackbydev@programming.devJ 3 Replies Last reply
                                      0
                                      • P [email protected]

                                        What's FE?

                                        S This user is from outside of this forum
                                        S This user is from outside of this forum
                                        [email protected]
                                        wrote on last edited by
                                        #63

                                        Front end

                                        1 Reply Last reply
                                        0
                                        • S [email protected]

                                          I use it at work, and it's finally getting an optimization pass.

                                          I wish I did Rust for work, but options are limited and I like my team. So I use it for hobbies until I have a reason to leave.

                                          M This user is from outside of this forum
                                          M This user is from outside of this forum
                                          [email protected]
                                          wrote on last edited by
                                          #64

                                          Yeah I've been playing around with rust but most know py. And to be fair on my it has fantastic libraries.

                                          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