I find a good way to delete comments from any programming language.
While using bat command, I found it can highlight the code. It was using a library called syntect in rust. But I'm not familiar with rust. So I decided to find a python highlight library. Finally, I found pygments.
It is simple to use and it can delete comments from any programming language easily. Take Python code as an example: