Philosophy of history, from social criticism to philosophy of science and back again