I don't think it will be fully compatible, but everything announced now you will get. Here are some examples of differences:
iPhone OS 3 - 3GS got voice control while 3G did not
iOS 4 - 4 got FaceTime while 3GS did not. But also the ip 4 got more alert tones (4.2 or 4.3) while the 3GS did not
Some differences will be mechanical (like if the next iPhone has an alert light), but they will probably not release some future features for the iP 4.
Well the 3GS doesn't have a front facing camera, how is it meant to get facetime
I can't believe some people are suggesting that the iPhone 4 won't support iOS 5 fully. There is no doubt about it, if anything you should be questionning whether the 3GS will completely support it, and even then I would be suprised if it did not. Where there is new hardware then it's relevant features obviously can't be included but that goes without saying..