This an example version of a cannon taken out of my ship called "Steamsailor," it basically does exactly what it sounds like it does, it fires, recoils from firing, and then resets back to the original position. It has two buttons on the bottom right side that allow for you to "roll out" and/or "roll in."
I think it is a pretty cool, but it is not very practical because it causes the opposite of performance optimisation.