A windmill is a machine that converts the energy of wind into rotational energy by means of vanes called sails . Originally, windmills were developed for milling grain for food production. In the course of history, the windmill machinery was adapted to many other industrial uses. An important non-milling use is to pump water, either for land drainage or to extract groundwater .