I'm going to oversimplify, so please forgive me here.
When the socialist revolutions happened and these huge number of people were killed, it wasn't because Stalin (or whomever) was bad necessarily, it was because Stalin was following Marx. Murder is the ideology.
So basically, Marx said you can't have rich people because they'll bribe the system, and you can't have educated middle class people because they'll resist. The only way to exact socialism is through "revolutionary terror", his words.
So yes, mass murder, genocide... Integral to the ideology. Hence the same color of the rainbow.
And I also understand that communism and socialism are two different, though related, things. But people use them interchangeably. Communism to me is like any other religion -great intentions but impossible to implement because people are naturally bad.