You can adjust the amount of sugar according to the acidity of the pineapple. In Kerala, very little sugar is added, since the local pineapples are quite sweet.
Peel and cut the pineapple into large cubes. Place in a pot with salt, turmeric and ¼ cup water. Cover and cook over medium heat until the pineapple is cooked (about 15 minutes). Transfer to a bowl and set aside.
Place the grated coconut, cumin, chile and 1 cup of water in a blender. Reduce to a smooth, thick purée. Add water if needed to ensure the blender continues to turn well. Set aside.
Purée the pineapple and the juice in a blender or food processor. Return the purée to a pot and cook over medium heat until it begins to thicken. Add the sugar. Cook until it’s well dissolved.
Heat the oil in a small pot. Toast the mustard seeds then add the curry leaves. Serve cool or at room temperature- keep in mind the average temperature in Kerala is 29°C.