Actually yes, Gun is definitely a necessary, especially for an interceptor role , and Rafale does have a 30mm gun as well.
There are several challenges in front of HAL and HAL isnt perfect either. But my point is, the IAF is purposely making the life more difficult for HAL and in turn...