Differentiable Programming \`a la Moreau