I did a philosophy minor, one class of which was the philosophy of ethics. There are many rules that definitely are not ethical today even if they were in the past so I don't think the point you're making really holds. Hammurabi (an eye for an eye) is probably one of the worst examples you could have cited.

Can't say I agree with this, considering lex talionis[1] is still the primary directive of most legal systems when it comes to criminal law, as well as basically all military operations (jus in bello, jus ad bellum, etc.). The principle of proportionality ("an eye for an eye") also is relevant to self-defense, capital punishment, etc.

In fact, I would counter and say that Hammurabi's Code is a quintessential example.

[1] https://academic.oup.com/jla/article/18/1/19/8471491

Lex talonis is an idea by humans, for humans. At it's core are dozens of untrue assumptions about the way the world, and the other actors in it work. All of those assumptions are about monkey social orders. Many of them are wrong.

For example it assumes the other party can fear, and has a sense of self preservation. Those things are often untrue of other humans, let alone machines.

More fundamentally it also assumes all sort of things about free will itself, implying that retaliation is "deserved" and other value judgments that only make sense if the other party has free will to begin with. Something which science tells us is debatable even about humanity.

No, game theory tells us the right answer and it's not "hold back when retaliating" or "teach them a lesson." Those are things only humans would do, and even then only the ones who share your neurology and upbringing.

Hammurabi's code may feel fundamental, but it's no more fundamental to the human condition than boys preferring blue to pink.

Morality is knowledge, and it evolves like other knowledge does.

It's not saying "Go and blind someone because it will be fun."

It's still an implementation of justice, and relies on a bedrock conception of justice as moral goal.

We don't agree with the implementation, but we still share the goal in the abstract.

The law isn't and never has been a moral benchmark. At best, a law reflects social consensus at the time of its enactment, but even that's not a given.

And proportionality matters. Community service and counseling, loss of time (imprisonment), and loss of a hand have all been used to punish theft. Which is correct? Which is the more moral, because it doesn't seem to me that they're the same?

I think there cannot be an objectively most correct punishment for a given crime. The closest we could maybe get is "undo the harm that you have caused", but some harm cannot be undone.

Hence morality and ethics, I guess.

Right, and that's the point.

The law isn't a moral benchmark, because morality shifts over time, both for what constitutes a crime, and what constitutes appropriate punishment. At various points in time, it's been legal to own slaves, illegal to be homosexual, and illegal for certain groups to vote (and I consider voting at all to be a subset of this); those laws (and ideas) were eventually updated, largely on moral grounds.

Similarly, most western countries no longer execute criminals.

But those ideas aren't universal, even today. Assuming that they are is imo, extraordinarily foolish, because there's ample evidence to show that they're not.