A near isothermal machine for compressing or expanding gas having a piston in a main cylinder with a heat absorbing and releasing structure attached thereto. The main cylinder contains a substantially constant volume of liquid maintained at a substantially constant temperature and a variable volume of gas, the gas t...