1/4 cup extra-virgin olive oil; more for brushing
6 Tbs. finely chopped fresh basil
2 or 3 large cloves garlic, finely chopped
1/4 cup crushed walnuts
Kosher salt
1 medium eggplant (about 1 lb.), peeled and cut into 3/8-inch slices
1 beefsteak tomato (about 1 lb.), halved
1 medium onion, peeled and cut into 3 or 4 thick slices
Freshly ground black pepper
1 lb. dried spaghetti
Freshly grated Parmesan Cheese (optional)
Prepare a medium-hot charcoal fire or heat a gas grill for 20 minutes on high. In a bowl, mix the olive oil, basil, garlic, walnuts, and 1 tsp. salt. Brush the eggplant, tomato, and onion with more olive oil, season with salt and pepper, and put them on the grill. Grill the tomato, turning only once, until the skin is blistering and the flesh looks mushy and cooked, 15 to 25 minutes. Grill the onion until soft and blackened on both sides, about 15 minutes. Grill the eggplant until golden brown and tender, 10 to 25 minutes. Coarsely chop the eggplant, tomato, and onion; put them in a large bowl along with their juices.
Meanwhile, bring a large pot of well-salted water to a vigorous boil and add the spaghetti. Cook until al dente; drain well. Toss the pasta with the vegetables and the basil mixture. Sprinkle with pepper; toss again and serve immediately, with freshly grated Parmesan Cheese, if you like.