Transitioning towards the next generation of computing architectures requires fundamental innovations at the transistor device and circuit level that comprise disruptive performance gains with focus on low-power and fast speed. Here, we will present the first ever ultrafast and cascadable all-optical transistor operating at room temperature. By using a ladder-type organic semiconducting polymer in an optical microresonator, an incoming optical signal can be switched on and off within less than a picosecond as well as amplified by more than a factor of 6500 with just a few micrometres device length. Furthermore, several transistors can be cascaded to realize OR and AND logic gate operation. By implementing a seeded non-ground state polariton condensation we configure a joint-denial truthfunctional operator i.e., a universal NOR gate. Such optical devices hold the promise of performing their operations faster than our current day devices by exploiting the ultrahigh oscillation frequency of light waves compared to today’s gigahertz-frequency electronic signals. Furthermore, devices which only need few photons to operate will bring the required switching energies down to the attojoule level.