Time programmable frequency combs enable new measurement paradigms for dual-comb spectroscopy (DCS) that are free of many of the constraints found in traditional DCS. As opposed to fixing the repetition rate offset between combs, free-form DCS is based on full control of the temporal offset between the dual comb pulse trains, thereby enabling user-selectable sampling patterns that optimize resolution, signal-to-noise ratio, species selectivity or acquisition time. Here we show that free-form DCS enables compressive sensing. We demonstrate compressive sensing at factors up to 155, with a corresponding reduction in acquisition time, while maintaining spectral resolution. We also demonstrate molecular recurrence sampling (which can be thought of as an extreme case of compressive sensing) for detection of a single gas with >15× higher sensitivity than traditional DCS. Finally, free-form DCS can more easily enable spectral imaging since its rf signal is narrow band, in contrast to traditional DCS, and therefore compatible with the finite readout times of focal plane arrays. We demonstrate imaging of methane plumes across a 128×64 pixel focal plane at a 250 Hz rate. In the future, this flexible free-form approach can enable applications ranging from rapid open-path spectroscopy to nonlinear multidimensional comb-based spectroscopy.