From 1963 to 2005, Fred Saberhagen (1930-2007) wrote a space opera series of short stories and novels about machines called Berserkers (a name given to them by humans). A long time ago, an extraterrestrial race built them as a weapon in a war against an other race, but something went wrong. The Berserkers exterminated also their creators and they began to explore space following one directive: to destroy life wherever they can find it.
The Berserkers are self-replicating, ruthless and learn from their errors. Their shapes and sizes vary: they could be construction bases the size of an asteroid, spaceships, smaller robots, humanoids disguised as humans and more. Sometimes, they capture humans to study them. There are some stories with time travel, (some of these stories were written in 1967, a long time before Terminator).
I read some of these books when I was a teen and I read again the two first short stories collections recently. These short stories are very good, with ingenious plots. Together, these stories don’t tell a linear story, the main war is more often a background. The stories show encounters with Berserkers from different perspectives and present some intriguing situations. An example: what do you say to a damaged Berserker who still wants to kill all life, but has forgotten what life is? (Mr. Jester).
There are also some literary homages. There is a Berserker version of The Mask of the Red Death by Edgar Allan Poe (Masque of the Red Shift) and a touching version of the myth of Orpheo and Eurydice (Starsong).