>>16730
>JS is already a very high level scripting language. If you want to write efficient JS, just write the damn JS. No typescript or other languages needed to output JS. You won't get better JS code by transpiling from another language. If anything, it will be slower.
It's perfectly possible for one language to be compiled to another and get decent efficiency. Just look at Typescript, which is a 0-overhead static typing layer on top of JS, and may even have an efficiency advantage if it gets an implementation that bypasses compilation to JS. Look at C and Rust, which produce decent assembly. However, there is a great difference between Typescript which improves upon JS and maps exactly to it, and compiling Rust to JS and getting a 192KiB "Hello, world!". I'm wondering if there is a language that is significantly better than JS, more so than TS, and compiles to JS that is decently efficient.
The goal here is primarily to avoid using low quality languages like JS so it's possible to write robust and simple programs with a lower rate of bugs than JS, and if there's a small loss in efficiency not because the language doesn't have a more performant design than JS, but because the only choice is to compile to JS because the web sucks, then that's okay as a tradeoff. And if those programs can run outside the browser better than the JS, that's another plus.