The Forelem framework was first introduced as a means to optimize database queries using optimization techniques developed for compilers. Since its introduction, Forelem has proven to be more versatile and to be applicable beyond database applications. In this paper we show that the original Forelem framework can be used to express and optimize Big Data applications, more specifically: k-Means clustering and PageRank, resulting in automatically generated implementations of these applications. These implementations are more efficient than state-of-the-art, hand-written MPI C/C++ implementations of k-Means and PageRank, as well as significantly outperform state-of-the-art Hadoop implementations.