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.
Well, then cast should also have a special effect because it can be used to
strip off any pragmas
{.pragma: raisesssz, raises: [Defect, MalformedSszError,
SszSizeMismatchError].}
Run
Makes a new pragma called `raisesssz`, which, when used, will imply `raises:
[Defect, MalformedSszError, SszSizeMismatchError]`
What does the `{.raises:[...].}` pragma at the top of a source file do, as in
your ssz_serialization.nim? The manual only describes it as a proc annotation.
We use it in our code to:
* Enforce noSideEffect (i.e. no access to globals, including stdin/stdout).
* Enforce handling of recoverable exceptions and make sure all kinds of
exceptions that can be thrown in inner function calls are accounted for or
handled or considered irrecoverable:
*
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 tha