For the pesto:
1/2 cup toasted pine nuts
1/2 cup grated pecorino romano, plus extra to serve
4 cups parsley leaves (tightly packed)
3/4 cup olive oil
Salt and pepper, to taste
For the pasta:
1 pound whole wheat spaghetti
1 tablespoon olive oil
2 large shallots, thinly sliced
3 medium garlic cloves, minced
2 cups fresh or frozen corn (from 4 ears of corn; defrost frozen corn before using)
Prepare the pesto in a food processor. Start by pulsing the toasted pine nuts until coarsely ground. Add the pecorino, parsley leaves, and olive oil. Pulse a few times, scrape the bowl with a spatula and pulse a few more times, making sure not to over-blend the pesto. Season to taste with salt and freshly ground black pepper.
Bring a large pot of salted water to a boil and cook the pasta until al dente. Meanwhile, heat the olive oil for the pasta in a large pan over a medium heat. Add the sliced shallots to the pan, and cook until softened, about 1 minute. Add the minced garlic and cook for another minute, or until soft and fragrant. Add the corn kernels and a pinch of salt and cook for about 5 minutes, stirring occasionally. Don't over cook the corn — you want some crunch!
Strain the spaghetti, then transfer it back to the pot. Add the pesto and toss to coat. Fold in the corn mixture and season to taste with salt and pepper.
Serve with extra grated pecorino on top.