Hi. I am a nim beginner. I am considering that nim as my js language. I wonder that the forum members' experience for the nim backend. How much code share is possible between plain nim and js nim code? 2018-02-13 10:54:32
Low-level code with pointers and memory may not work in JS as you would expect. IO in js is different. Closure iterators are not available in js, but they are pretty specific to their use-cases. Other than that the code is pretty cross-platform. nimx is one of numerous examples of cross-platform libs.
2018-02-13 15:34:04
@yglukhov how do you make an ajax or XHR request in nim? 2018-02-13 16:54:41

there's a nimble package for it

install by doing nimble install ajax

2018-02-14 04:18:58

Compared to another compile to JS language ReasonML, I would say that its similar in compile time performance to ReasonML which is known to be fast. Personally I think it has better FFI than ReasonML. The base ReasonML language might be arguably more expressive than Nim though of course Nim has an extremely powerful Macro system which ReasonML does not.

What ReasonML compiles to is much more readable though Nim JS does have good stack trace.

The Nim type system is much more powerful than Typescript.

For web Nim can offer a true full stack experience with backend web services in the form of a statically compiled binary, devops tools created in Nim, and of course the JS frontend.

Nim JS is set up for monolith bundles for SPAs ( like webpack/rollup etc ) though in the future with HTTP2 and progressive web apps likely to become more and more popular the monolith bundle is not likely to remain popular as a distribution model. Instead you will have lots of libraries and components loaded on pages as needed.

2018-02-14 22:47:43