I went from Go and recently had an interest in Web Assembly, but I do not feel that Go is particularly good for it, mainly due to the large binary size. So I look around for a new language and Nim seems perfect for it, modern, fast and makes even binary files even under the web.
Have I found some effort since last year, but have there been recent developments or plans for the future?
Whether you compile the Nim code to wasm via C/Emscripten or via Nim's LLVM backend (nlvm) does not matter, these toolchains will all benefit from the outlined changes. Note that a direct wasm backend is currently not planned, but I expect the community to provide one. A Nim-to-wasm translator is a nice greenfield project to learn about compilers.
This thread could use some pointless grumpy whining. (Or at least that's all I can contribute right now.)
I'm wondering about the future of nim js.
Nim has invested considerable effort into the JS backend - time that could have been invested into delivering a more competitive "product" with just the C backend, stabilization, documentation, etc.
Then WASM comes along and (although it's not fully baked yet) it seems that Nim's JS backend efforts are now somewhat less valuable...
And remember - you are mortal!
Be depressed... Be very very depressed...
Fin.
Then WASM comes along and (although it's not fully baked yet) it seems that Nim's JS backend efforts are now somewhat less valuable...
Let's look at how big that "somewhat" actually is according to some specific aspects of WASM vs JS in the browser:
I'm not sure I agree with these sentiments...
The JS backend gives Nim the potential to attract a whole world of developers, who might not be exposed to the language otherwise. Not that I personally want a bunch of JS devs shaping the future of Nim, but fortunately for us, the language has sensible leadership and decision makers planning its future.
As @gemath pointed out - WASM isn't billed as a replacement to JS, and I'm not sure competitor is even the right word either.
I think WASM is the next iteration of binaries in the browser - so think Java Applets, Macromedia Flash, etc...
The difference b/w those and WASM is that WASM is an "open standard" and WASM seems to also focus heavily on interoperability b/w JS and Native code compiled to WASM.
I think - until someone develops something useful with WASM in another language, or there is real reason to buy into the WASM hype - there's not much reason to sorry about Nim lacking a proper WASM target. You can get there today via emscripten.
WASM itself still has a lot of growing up to do anyway, according to - https://hacks.mozilla.org/2018/10/webassemblys-post-mvp-future/
In case you want to give it a spin, nlvm has had some wasm support for some time now: https://forum.nim-lang.org/t/3758
there's a new llvm version in place since that post which should hopefully be an improvement, but do let me know if you have any success or failure with it.