Re: Benefit of the effect system?

2020-07-02 Thread federico3
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.

Re: Benefit of the effect system?

2020-07-02 Thread Yardanico
Well, then cast should also have a special effect because it can be used to strip off any pragmas

Re: Benefit of the effect system?

2020-06-30 Thread Yardanico
{.pragma: raisesssz, raises: [Defect, MalformedSszError, SszSizeMismatchError].} Run Makes a new pragma called `raisesssz`, which, when used, will imply `raises: [Defect, MalformedSszError, SszSizeMismatchError]`

Re: Benefit of the effect system?

2020-06-30 Thread snej
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.

Re: Benefit of the effect system?

2020-06-30 Thread mratsim
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: *