Starting with a real vector space V, one can canonically construct a complex structure on the direct sum of two copies of V, and a symplectic structure on the direct sum of V and its dual. One way to interpret this is that, starting with a complex vector space one can dualise "half of the directions" to obtain a symplectic vector space, and vice versa. In the first half of the talk, I will explain how this procedure makes sense more generally for torus bundles (T-duality). The major difference with the linear model is that the symplectic and complex manifolds obtained by rescaling the fibres are not in general isomorphic, so that duality makes more sense as a statement about families. Strominger, Yau, and Zaslow thus proposed that this would provide a geometric explanation for mirror symmetry, i.e. that mirror families of symplectic and complex manifolds should arise from total spaces of dual torus fibrations. Mirror symmetry encompasses including relations between Gromov-Witten invariants and periods, or Lagrangian submanifolds and sheaves, and it thus becomes important to derive these deeper connections from the basic geometry of T-duality. In the second half of the talk, I will turn to the main difficulty of implementing this program, which is that the invariants coming from the symplectic side cannot in general be compared with ones coming from complex geometry because they take the form of series with possibly vanishing radius of convergence. Kontsevich and Soibelman thus proposed to consider the mirror as an analytic space defined over the field C((t)) equipped with the t-adic valuation. I will indicate what T-duality means in this setting, and the ideas that enter in the proof of homological mirror symmetry in the simplest class of examples which arise from these considerations, namely Lagrangian torus fibrations without singularities.