I don't really buy revenge as a distinct thing from punishment. Revenge is just the lizard brain's conception of punishment as a general method for social behavior modification without the benefit of statistics or specific evidence. Which is the reason why it isn't a legitimate goal. Punishment in proportion to the offense and targeted using evidence to achieve the desired results can be socially beneficial. Revenge is nothing but undirected violence rooted in irrational anger and fear.
You have quite different intentions when you're punishing your child because he didn't do his homework vs. when you're punishing your friend because he stole your girlfriend. In one case you aim for blood, in the other - for betterment and growth. Intention makes all the difference here, otherwise, they are, like you say, both just forms of violence.