Peel and prepare the pineapple into bite sized cubes, or buy the ready prepared pineapple. If using canned, then choose one that is NOT canned in sugar syrup.
In a heavy bottomed wok or a pan, heat 2 tsp coconut oil. Add the 2 red chillies, mustard seeds, curry leaves and pinch of asafoetida. Add the pineapple cubes and toss for a few seconds. Add the water, tamarind paste / pulp, bring to a simmer.
Cover and cook till somewhat soft - this should take 8-10 minutes, but do check that it doesn't turn mushy.
While the pineapple is simmering, in a smaller pan, toast the ingredients for the masala (except the coconut) until the chana dal is golden brown. You can toast each of them individually if you have more time on hand, such that the cumin, coriander and fenugreek seeds are lightly aromatic, the dals are golden brown and the red chillies crisp up.
Grind this along with the coconut to a fine paste, using up to 1/2 cup water.
Add this paste to the nearly cooked pineapple pieces and bring to a simmer for 2-3 minutes.
Remove into a serving bowl.
Heat the oil for tempering in a small ladle / pan. In hot oil, splutter mustard seeds, red chillies and curry leaves and transfer on the top of the curry.
Serve with steamed rice.