"cool algorithms that could have inferred types as much as possible" - like Hindley-Milner type system? Like OCAML/Haskell/F#? There is only one reason JS could be chosen. Because it's everywhere. Almost any other modern language is realistically better. But unfortunately Web is Closed to JS/HTML/CSS.