Which is the best language to do this?
Whichever you are most comfortable with. There are lots of examples of successful window managers in many different languages out there. Qtile and xmonad are good examples, written in Python and Haskell respectively.