Revenge" sound like you've penalized someone by either your feeling or emotion ,in some case both of two. you need them pained as you had.
on the contrary, punishment by law you've must to avoided sentence someone by your feeling or emotion,
But I heard too many criticized about law by they feeling.