Hi there,
Context: I am an experienced programmer (Scala, Java, JS, Rust, ...) just discovering Nim through the doc. I haven't even open my editor yet to write some Nim!
I really like the idea of an effect system but I am struggling to understand how its used in Nim. My first impression is that it looks more like a compiled-check documentation thing; You optionally declares it and the method caller does not need to handle it in any way. You can also use it to enforce the presence/absence of effects.
Am I rightor can the effect system be used in to manipulate the effects?
When talking about effects system I am usually thinking about the IO monad in Haskell or library in scala like cats-effect which purpose is to keep your functions pure (as in referentially transparent) and lets the method caller decide when and how to execute the side effects.
Do you any real world code example that makes you think "Here the effect system is used at its full potential"?
Bonus Question: Can you trick the tracking system and stop the propagation of .tags or force .nosideeffects (the same way debugEcho does)?
{.pragma: raisesssz, raises: [Defect, MalformedSszError, SszSizeMismatchError].}
Makes a new pragma called raisesssz, which, when used, will imply raises: [Defect, MalformedSszError, SszSizeMismatchError]
I wish the effect system could be used to implement sandboxing.
The stdlib procs that run system calls could be tagged accordingly, and the application's "main" could then set up a sandbox at runtime to allow only the required system calls.