Persistent data structures <https://en.wikipedia.org/wiki/Persistent_data_structure> are a fundamental idea of functional programming. With that, it is possible to create new instances of constants without altering them, which is obviously beneficial for multi-threaded programming.
Is this supported in Nim?
I have looked into the available documentation, have not found anything yet.
You mean something like immer.js ?
I think not, but it would be very easy to create library like this
Yes, I think so. I am wondering that it is not yet implemented, if so. So far as I am informed are the different kinds of implementation different in terms of memory usage and so.
Why do you think its easy?
First place to check for libraries in general is https://nimble.directory (Nims version of npm)
We do have this: https://github.com/PMunch/nim-persistent-vector by @PMunch
Immutable data structures are possible in Nim, but I would not call it easy. Such structures are very difficult to optimize. Immutable structures are expensive!
Immutable data structures and that style of functional programming is not really the "strong point" of Nim. Nim is a much more low level language, where we care about memory and performance. It's the same reason you don't have immutable data structures by default in a language like Rust.
I don't want to put you off completely. Nim has some very powerful functional programming libraries. This one for example, is one of my favorites: https://github.com/zero-functional/zero-functional
In regards to translators from other languages to Nim, the biggest one is Py2Nim. This was used by Status to convert a complex crypto codebase to Nim very effectively: https://github.com/metacraft-labs/py2nim
We also have nimterop, which isn't a full translator, but converts C / C++ header files to Nim for a better interop experience with those languages. https://github.com/nimterop/nimterop