Spectra and fast multi-wavelength variability of compact jets powered by internal shocks