Text this: Hamiltonian and gradient flows, algorithms and control