If there is one language that could effectively (and efficiently) replace JavaScript is Nim.
I know, a hot take. Yet, think about it. Nim officially had the motto of being the "one language to rule them all" (though @Araq later rephrased it into: "good for everything language"). Isn't that what JavaScript folks are trying to push (except, it is not fit for low-level systems programming)? And obviously, Nim is the better designed language and the one that spits out high performance code. However, JavaScript is specified by TC39 which has a huge backing of all the major big-tech companies. So, that results in much better documentation, marketing, and support. That makes it hugely popular. I think the only way to make Nim go mainstream now is to give it to a foundation or some corporate body that has huge monetary backing. However, I don't think @Araq and the others are not interested in that. I personally don't think it's a bad thing. I don't trust any of the major tech companies. Yet, I think that's the only way to make it "mainstream".