We explain how, starting with a stack of D4-branes ending on an NS5-brane in type IIA string theory, one can, via T-duality and the topological-holomorphic nature of the relevant worldvolume theories, relate (i) the lattice models realized by Costellos 4d Chern-Simons theory, (ii) links in 3d analytically-continued Chern-Simons theory, (iii) the quantum geometric Langlands correspondence realized by Kapustin-Witten using 4d N = 4 gauge theory and its quantum group modification, and (iv) the Gaitsgory-Lurie conjecture relating quantum groups/affine Kac-Moody algebras to Whittaker D-modules/W-algebras. This furnishes, purely physically via branes in string theory, a novel bridge between the mathematics of integrable systems, geometric topology, geometric representation theory, and quantum algebras.