Hacker News new | ask | show | jobs
by kjksf 3280 days ago
WebAssembly is in a large part about re-using vast quantities of existing C/C++ code in the browser.

C++ will dominate in that space over Rust for the same reason it'll dominate in all other spaces: the amount of existing C++ code and the number of existing C++ programmers will always dwarf the amount of Rust code and Rust programmers.

Even if Rust was uniformly 10-20% better than Rust, economics dictate that for most people it'll make most sense to continue with C++ than rewrite thousands or millions lines of code in C++ or embark on months-long retraining of large number of programmers, some of which will not be happy about going from being proficient C++ programmers to beginner Rust programmer.

And that's why we don't need to mention Rust when writing about WebAssembly. At this point in time it's immaterial to the subject.

1 comments

I tend to agree with you in the context of porting existing C/C++ code to the Web is going to follow exactly the pattern you mention.

But, for new software, with no previous dependencies? The stdlib in Rust is decent, and the ecosystem is growing quickly. For new projects, I do think these will help in it's adoption in a new environment like WebAssembly, but we shall see!

For me Rust is a deja vu experience, in a certain sense.

I started to use C++ around 1992, on MS-DOS, as my next loved programming language after Turbo Pascal. Never saw any value in plain C, other than writing code unsafer as straight Assembly (Assembly has less UB than C).

Have taken part in C vs C++ flamewars on Usenet since those days, only to see C++ finally overtaking C in many fields in the last 10 years.

In some fields, like embedded programming, C still reigns over C++.

So while I look forward to have my managed languages, OSes and performance critical libraries written in a safer language, my life experience tells me it will take a few decades to achieve the same level of market adoption.

By no means do I believe it will overtake these other languages quickly. But one huge benefit that Rust has over these others is this idea of "fearless programming". Watching Ruby Devs jump into Rust, fight the compiler for a bit, but then have a blazing fast app with some very detailed systems level interaction, is amazing. On top of that, it never segfaults!

Jumping into C and C++ is in my own experience, much more difficult. All of the complexity of those languages disappears into the Compiler in Rust. I think the big thing here is that Rust can appeal to many developers from all walks, not just those of us who've spent years or decades with Assembly/C/C++.

I agree, but also feel a bit sorry for Ruby devs, in the sense that they could have had that experience with Dylan or even with Apple's short love with a Ruby AOT compiler (which eventually became RubyMotion), while staying in Ruby.