Benjamin Thomson, lord of Rumford was the first to have the idea of equivalence between heat and work, which can be transformed one into the other. He measured the conversion factor, for which he published in 1798 a nearly correct value:
One calorie ($cal$) is quantity of heat required to raise the temperature of 1 gram water by 1 degree. One Joule ($J$) is the work required to apply a force of 1 Newton along a distance of 1 meter. Conversions: $1\; cal$ $=$ $4,184\; J$ $1\; J$ $=$ $0,239 \;cal$
The first principle of thermodynamics, a generalisation of Rumford's observation, was formulated independently 40 years later by Mayer and Joule :