Abstractions For Efficient Machine Learning And Nested Data Processing