The relationship between periods of automorphic forms and L-functions has been studied since the times of Riemann, but remains mysterious. In this talk, I will explain how periods and L-functions arise as quantizations of certain Hamiltonian spaces, and will propose a conjectural duality between certain Hamiltonian spaces for a group $G$, and its Langlands dual group $\check G$, in the context of the geometric Langlands program, recovering known and conjectural instances of the aforementioned relationship. This is joint work with David Ben-Zvi and Akshay Venkatesh.