An optimist's guide to a future run by machines