Explore write-tracking/escape analysis to avoid copying seq to closure
Not implemented: https://nim-lang.org/docs/manual.html#effect-system-read-write-tracking

Reference ticket: https://github.com/nim-lang/Nim/issues/3377

> Solution 3.
> In the example above we could mark s as lifted variable. This would change the signature of giveMeProc from giveMeProc(s: seq[int]): proc() to giveMeProcs: mustBeOnTheHeap seq[int]): proc(). We also need to keep track of the variables: the giveMeProc(@[1,2,3]) is a call with parameter which is in static, therefore we need to copy it before the function call.
> This solution is not that easy to implement and also has some bad implications. In the following case:
> 
> proc wrapper(s: seq[int]): proc() =
>   result = giveMeProc(s)
> we need to realize that the parameter of wrapper needs to be on the heap. Moreover, if at the implementation at wrapper we might not now the actual implementation of giveMeProc, therefore we actually need to introduce an additional keyword to the language (to indicate that the parameter s needs to be on the heap at forward declarations).

> Solution 3 is essentially:
> 
> proc wrapper(s: seq[int]): proc () {.escapes: [s].}
> 
> That's why I told you to look at my writetracking. ;-)
> Escapes: [s] means you cannot pass a static seq to it.