Hello, I don't know if it has been asked before:
nowadays, there are a few languages whose specialty is compiling to javascript, while at the same time are much closer to Nim in terms of semantics and features, notably typescript, and others like dart. typescript is backed by microsoft. Now that Nim version 1.0 is out, would it be a wise long term decision to target ts instead of js? (perhaps not instead, but in addition to)
An additional advantage is that code produced can be more readable, than "expanded" javascript (expanded: implementing features js doesn't have with more code), so it plays better in team scenarios.
I know the js backend had much effort put into it already, but I am asking strictly in terms of merit -- longer term it seems the better path.
What are your thoughts on this?
But we can already use Google Closure compiler.
Also Nim is already readable and can already target WASM. I expect going to WASM through C or directly via LLVM is much more efficient. Javascript and Typescript probably lose all relevant type information, especially for integers and arrays. I expect JS -> WASM compilers need a lot more heuristics to understand what the programmer meant when C/C++/LLVM IR carry a lot more information.
It is not "generated semi-obfuscated code" it's just generated code. And producing more "human-like" code is more effort, not less.
They also support newer versions of javascript like es2015, which are more concise.
So what? We don't need new JS features, we compile to JavaScript.
But translating to high-level JS code would require to keep up with the new features (or babel) while compiling to low-level JS code is future proof.
And Google Closure compiler works.