The field of artificial intelligence & machine learning (AI/ML) has experienced unprecedented growth over the last decade driven by computationally demanding applications. The computing power has been so far provided by general-purpose digital hardware such as central processing units (CPUs) and graphics processing units (GPUs). As the potential for continuous technological advancements in digital electronics is brought into question, research is focusing on alternative paradigms such as application-specific analog hardware. Both electronics and photonic analog hardware are being actively investigated with promising results showing advantages in terms of processing speed and/or energy efficiency. However, a systematic comparison of these different hardware platforms in terms of high-level computing performance is missing. In this work, we compare these hardware platforms focusing on use cases with different requirements in terms of, e.g., compute capacity, efficiency, and density. The comparison highlights current advantages and key challenges to be addressed in each field.