Modern data science pipelines employ a variety of workloads going beyond arrays and tensor processing, including graph processing algorithms, and relational query processing. This results in the use of loosely coupled data processing frameworks that move the data across the analytics pipeline, leading to unnecessary resource and energy consumption. This talk presents a compilation-based approach to move the computation closer to the data. This is achieved by designing domain-specific languages that leverage the structure of data with algebraic optimizations. We show that our proposed approach significantly outperforms state-of-the-art frameworks for a wide range of applications, including database query processing, tensor processing, and quantum simulation.