Say program A is licensed under GNU GPL 2.0. I write a new program (B) which is heavily inspired by A. Both do pretty much the same thing with some small differences (B has a couple of old features removed and a new one added) and they look almost the same.
The only meaningful differences are that B has been rewritten in a different language and had a general code cleanup. But in general, the way the program works is the same as the original.
Does B have to be licensed under GNU GPL 2.0 too? Or since it's not a direct copy of the original it can use any licence I want?
Of course the original project will be mentioned in the README either way.