A library for magic programming