A framework for programming and optimizing temporal graph neural networks