Two ways to compactness