or one driving a mosfet but for this last one you need an extra power source of about 10V or something like that.
JS
There exist voltage out optocouplers designed for driving the gate of a mosfet without an external supply. In fact, using a dual unit with 2 back to back mosfets, you will create your own AC switch. Note that switch off speed is fast, but, nowhere near as fast as a mosfet driver as these special optocoupler's photovoltaic's discharge slowly. The choice of pulldown resistor speeds this up, but, loads the output voltage as the photovoltaic optocoupler's output current is low.
In fact, this is how the DC/AC solid state relay ICs (the ones with 2 back-2-back internal mosfets like my digikey post above) actually internally work.