Some countries essentially do this (e.g. caning in Singapore).
[1] https://singaporelegaladvice.com/law-articles/what-is-a-beyo...
Reply on news.ycombinator.com