Recent experimental investigations have confirmed the possibility to synthesize and exploit polytypism in group IV nanowires. Driven by this promising evidence, we use first-principles methods based on density functional theory and many-body perturbation theory to investigate the electronic and optical properties of hexagonal-diamond and cubic-diamond Si NWs as well as their homojunctions. We show that hexagonal-diamond NWs are characterized by a more pronounced quantum confinement effect than cubic-diamond NWs. Furthermore, they absorb more light in the visible region with respect to cubic-diamond ones and, for most of the studied diameters, they are direct band gap materials. The study of the homojunctions reveals that the diameter has a crucial effect on the band alignment at the interface. In particular, at small diameters the band-offset is type-I whereas at experimentally relevant sizes the offset turns up to be of type-II. These findings highlight intriguing possibilities to modulate electron and hole separations as well as electronic and optical properties by simply modifying the crystal phase and the size of the junction.