1. 32
  1. 15

    I don’t think Rust will supplant Javascript as the language for frontend development. It’s powerful but also difficult. Maybe my experience is atypical, but I’ve tried three times to learn it and thrown in the towel each time.

    Maybe this will be the year… I have no particular love of the language, but the way I see it, I tend to be the guy who takes a second or third stab at startup’s product (cleaning it up, productionizing, optimization, etc) and in a few years a lot of those programs will be written in rust… cause that’s what’s cool right now. And I’d still like to code in 10 years, so I guess I need to learn these things.

    I don’t think Dart will either, but it’s strangely seen a resurgence in popularity. I guess due to flutter?

    1. 8

      I don’t see Rust replacing JS in areas JS is used currently, but Rust+WASM may enable new kinds of web applications that wouldn’t have been written in JS. For example, AAA games or big productivity applications could use the Web as yet another platform alongside native platforms.

      1. 6

        As someone who uses both JavaScript and Rust at work, and aware of the webassembly story, I think you are semi-right.

        Rust is hard because we are not use to its semantics, but once you understand the system it’s actually very easy.

        But it will not be that. Regular people, people who cannot spend days bending their mind to the semantics of a language, will never use Rust for webdev.

        The reason why JavaScript is growing even more for webdev, is one word: accessibility. And it’s only becoming more accessible.

        We are seeing small, embeddable JS VMs now. So JS can live everywhere and be performant when needed.

        100% agree though Rust is fantastic for backend, and that’s where I used it at work. Writing Rust services and system programs is the holy grail.

        1. 3

          To be fair I like Go a lot more. Rust is too much like C++ to me. A language for experts, and realistically I doubt I can ever really feel confident in my own ability to use it successfully. I prefer a simpler programming language.

          But I guess that’s a lost cause.

          Of course in a decade it will be some other language. Maybe everyone will get interested in dynamic languages again.

          1. 3

            At some point, addition was a difficult thing, and multiplication and division were as much of an arcane techniques as dependent types and automated theorem proving are now. These days we teach multiplication and division to kids, and most of them learn it just fine.

            We are sort of getting to the point when ADTs and pattern matching become mainstream. Maybe in two decades affine types will be a widely understood thing rather than something people need to bend their minds to.

            1. 4

              Are you really trying to equate addition to Rust?

              Addition is something that has been natively understood since ancient times. Addition was used by the Greeks 10,000 years ago.

              I study programming languages in my free time, and Rust is one of the most Byzantine languages I have ever used.

          2. 5

            I agree that Rust takes some time to learn, but as it’s ecosystem matures it will make more sense to use it to for the backend. And there are benefits on using a language for both backend and frontend (only one language to learn, reusing logic, etc.).

            Rust is improving its ergonomics so maybe in 10 years it will be an easier language to learn/use than today (or a total mess like C++)

            1. 10

              Not that I particularly like it, but we already have Javascript on both the frontend and the backend. The problems Rust solves I don’t really see in web dev.

              1. 4

                The problems JS solved had nothing to do with the backend, but we saw it there anyway.

            2. 4

              I bounced off rust four times before I managed to write even simple programs in it. Each time, I internalized a little more intuition about ownership.

              It’s so different it requires the kind of learning I haven’t had to do since first starting to program - much more different IME than going from imperative -> OO -> FP code. More like learning type systems for the first time again.

              1. 4

                Do you use other languages with manual memory management? I find myself talking about ownership in C++ all the time. Rust gave me terms for it but all the considerations are necessary for C++ as well.

                1. 1

                  I don’t use them often, or well. I spend most of my day in very high level application code.

              2. 4

                I don’t think Rust will supplant Javascript as the language for frontend development.

                Crazier things have happened. For example, Javascript became the language for frontend development.

                1. 2

                  Yes, Flutter is definitely the reason that Dart is seeing a resurgence.

                  1. 2

                    How did you go about learning Rust? I tried to learn it in the way I learned Go, by simply going through the documentation and attempting to write very simple programs in it but didn’t make much progress.

                    Then I took a step back, downloaded the book on my e-reader and started reading it. It is very well done and a total game changer for me.

                    I actually think the semantics of Rust quite simple now, I just wasn’t used to it at all in the languages I learned previously.


                  2. 7

                    Reminds me of a related blog post I read today: The Eternal Novice Trap https://feoh.org/2019/12/27/the-eternal-novice-trap/

                    1. 4

                      Indeed, me too. Was especially reminded by this through another post shared here on Lobste.rs where the author shared he would be focusing on like six or eight different languages in the new year. And then this one followed. :-)

                      1. 4

                        Me too.

                        However, that article could have been from “me ten years ago”. So I can emphasize with the author as well. 😉

                    2. 6

                      “Wasm is probably the future of the web”

                      Famous last words. Anything that bets against javascript is doomed so long as javascript is required to make the page do things. I suspect WASM will be used by some, and javascript will be used by all.

                      1. 2

                        If all major browsers end up supporting WASM, it can be used to manipulate the DOM, which means it can replace JS.

                        1. 2

                          I mean it can do anything if the authors can decide what it can do. So saying this isn’t too insightful.

                          Do you think major browsers WILL end up supporting WASM, and to manipulate the DOM, and all the APIs? What is the gain, when JS is adapting to be easier to use year by year? And TypeScript?

                          1. 5

                            Looks like the major browsers already do support WASM: https://caniuse.com/#feat=wasm

                            As for DOM manipulation, it looks like that may already be possible in both Rust & C++: https://rustwasm.github.io/docs/wasm-bindgen/examples/dom.html https://mbasso.github.io/asm-dom/

                            1. 1

                              don’t let me dampen your excitement. WASM will be used by some, extensively even. I just don’t think it’s reasonable to think that it will completely replace JS for everyone.

                              1. 1

                                I don’t think JS will vanish. But I dispute the claim that it “will be used by all”.

                                1. 1

                                  sure, I would too. I don’t think anyone is making that claim though.

                                    1. 1

                                      ah, yeah I did. Thanks and sorry about that. Somehow I lost my train of thought. Next time I’ll read my posts more thoroughly before I put my foot in my mouth…

                          2. 1

                            only if you intend on not supporting older browsers.

                            1. 1

                              Eventually those age out enough for it to become feasible.

                        2. 2

                          Rich Hickey’s talk on becoming a better developer has a great quote on the topic:

                          Musicians get better by practice and tackling harder and harder pieces, not by switching instruments or genres, nor by learning more and varied easy pieces. Ditto almost every other specialty inhabited by experts or masters.