Distant, dusty and extremely luminous galaxies form a key component of the high redshift universe, tracing the period of intense cosmic activity that ultimately gave rise to the present-day universe. These highly luminous galaxies, first detected in the ground-based submillimeter region, are however optically very faint, which hampers identification of the optical counterpart and the measurement of a redshift. We are developing a new direct-detection submm spectrograph DESHIMA. By taking advantage of the rapidly advancing technology of superconducting microresonators, DESHIMA will revolutionize the appearance and capabilities of a submm spectrograph. There will no longer be large grating optics; instead DESHIMA will be equipped with a single chip, onto which the entire system of a dispersive filterbank and MKID sensor array is integrated. This chip will host 5000-10000 MKID sensors to instantaneously cover the entire submillimeter wave band (320-950 GHz) with a resolution of f/Δf = 1000, further multiplied by 6-9 spatial pixels. With the broader bandwidth and higher detector sensitivity, DESHIMA will be very efficient compared to ALMA in picking up THz lines from submm galaxies with unknown redshifts. The expected outcome of this project is; 1) a record of the properties and evolution of distant luminous galaxies, 2) a powerful and compact multi-purpose spectrometer suitable for future ground base telescopes as well as satellite missions, and 3) the emergence of a new branch of observational astronomy based on flexible on-chip submillimeter optics.