OK, so I've been playing and benchmarking ideas of how to implement an (uint64) stack in Nim. (seq-based, array-based, and timing push'es and pop's)
How would you approach this? (my main concern is speed)
There should be no difference.
The only optimization I see that could improve perf is not using a stack at all (but just to avoid allocations) if your algorithm can accomodate that (i.e. stackless depth first search for example) but we would need more context.
Stacks are very very fast.
If you know roughly how large the stack seq can get, you may want to try
https://nim-lang.org/docs/system.html#newSeqOfCap%2CNatural
to avoid or reduce reallocations.
In a small benchmark I wrote some time ago, using newSeqOfCap to set the initial capacity made a noticable difference compared to using newSeq.