Now that we are getting closer and closer to the finish line for Nimony, I'd like to start a thread here for the js backend.
We need it (IMO). It's one of the features that drew me in about Nim ;)
I personally don't have the time to help, but I do have some coin and I'm happy to support commercially.
Curious to hear everyone else's thoughts about having js integrated and maybe discuss assembling a task force for this lol?
I completely agree, javascript frontend is really important thing and I hope that nimony will have it. But besides it, I would like to have wasm backend as a separate backend and as used inside js backend:
proc jsProc
proc wasmProc {.wasm.}
proc myCoolAlgorithm*() {.wasm.} =
jsProc()
wasmProc() This will speed up some algorithms. In addition, you can add
import foo {.wasm.} Because annotating each procedure in the foo module can be annoying. By the way, the wasm backend is useful in itself, for example, a situation may arise when you need to run someone else's (not always safe) code in a sandbox. And wasm copes with this and at the same time works quite fast with its jit I started working on one a while ago ...
This is awesome!
That is what I thought too. Actually, kind of took it for granted that it would come after the main idiomatic design choices for Nim 3.0 are ironed out. Nim→JS is quite popular indeed. There was another discussion where the topic was touched on: https://forum.nim-lang.org/t/8727
I was of the impression from Araq's reply that this wasn't something that Nimony would do, at least to start with, but a separate pipeline that wouldn't need to depend on Nimony.
Not something I would be particularly worried about either way. However, if Nimony with NIF, NIFC, and LLVM target subsequently, were to unleash Futhark-ish capabilities for wrapping C++, that's a bigger win.
I was of the impression from Araq's reply that this wasn't something that Nimony would do, at least to start with, but a separate pipeline that wouldn't need to depend on Nimony.
No, most of the pipeline would be and will be re-used.
This is not only about speed and memory efficiency, although that's a great deal for a plethora of applications. Nim, being a systems language, is easier to map to an ArrayBuffer-based code, without tons of when defined(js) and compilation errors.
Interoperability should well be preserved with proxies for exported types, we shouldn't worry about code out there that relies on internal implementation details. Interoperability with existing backends (c, c++) and a possible wasm backend is a big win.
Nim, being a systems language, is easier to map to an ArrayBuffer-based code, without tons of when defined(js) and compilation errors.
Maybe, I don't know. It's very risky, I see the value in Nim's current scheme powering Karax, I don't see the value in: