Place the grated coconut into a small to medium pan and dry fry or roast until it turns a dark golden brown. This takes about 7 to 9 minutes over medium flame. Watch it carefully because the coconut can burn easily and keep stirring to allow the coconut to brown evenly.
While it is still hot or warm pound the roasted/fried grated coconut in a pestle and mortar until it becomes a thick brown paste and the oils exudes. Scrape it up and put it in a medium bowl.
Pound the fresh chillies and bird chilies, if using, until it is quite fine or pasty and throw that into the bowl too. Mix the tamarind paste with 2 tablespoons of water and strain and pour that into the bowl as well. Squeeze the limes, discard the seeds and pour that in as well. Stir the mixture until it is well combined, add salt to taste and adjust sourness with extra lime juice if necessary and sweetness with a tiny sprinkle of sugar if you like. Mix well.
Add the raw bean sprouts, sliced shallots and boiled cockles if using and toss well incorporating the dressing into the vegetables/cockles well. Taste for salt again and adjust. Serve slightly chilled or at room temperature.