Roast the first four ingredients for the masala until reddish. Grind into a smooth paste with the coconut milk.
Boil the pieces of bitter gourd with half the tamarind water, adding more water if necessary, until the vegetables are tender. Drain and reserve.
Heat the remaining tamarind water in a saucepan.
Add the ground masala and let it simmer for a couple of minutes
Add the cooked mixture of bengal gram and tuvar dal and the drained bitter gourd.
Add salt to taste and simmer about 10 minutes
Heat oil in a separate saucepan. Add the mustard seeds and curry leaves. Once the mustard seeds sputter, add to the cooked Pitlai.
Serve hot with rice.