stack: introduce stack library