In the Malay epic Sejarah Melayu, Hang Nadim (Jawi: هڠ نديم) was a very young Malay boy of great ingenuity who saved Temasek, now called Singapore, from attack by shoals of a species of swordfish named todak; attacks which cost many indigenous Malays their lives.
In the Sejarah Melayu, the boy who saved Temasek from the swordfishes is not given a name. The name Hang Nadim was only given to the character after later adaptions of the story publicized by popular culture.
Hang Nadim is the name of a character in the Sejarah Melayu, however that character appears in a different chapter and is unrelated to the story of the boy who saved Temasek from the swordfishes.
It is mentioned in the traditional accounts that the attacks were a curse because the reigning Maharaja had ordered the death of a pious man from Pasei called Tun Jana Khateb.
The initial plan of the raja to counter the attacks was to have his men form a barrier of legs along the shores of Temasek to protect the country but the number of swordfish were too numerous and it only cost more lives to be lost. After which, among the people, Hang Nadim spoke up and advised the ruler of Temasek, the Maharaja, to build the barrier with banana stems instead. The effort was successful as the swordfishes' snouts were trapped by the barricade of stems.
According to legend, the place, Tanjong Pagar in modern-day Singapore, takes its name from the barricade. In the Malay language, tanjong pagar or tanjung pagar means "cape of stakes".
The Maharaja was furious because he had been outwitted by a boy. So he decided to hire assassins to murder the boy. The boy lived on top of a hill so that night, the assassins murdered him in his sleep and all of his blood flowed into the hill, thus the name Bukit Merah (Malay for red hill).