Right now we have to explicitly add all supported backends to switch tables in createBackend (and createDeviceManager). It'd be nice to use a static registry pattern (I think https://www.bfilipek.com/2018/02/factory-selfregister.html is a decent overview of this pattern) to allow backends to register their existence at startup. That will also break an annoying dependence cycle where Backend depends on DeviceSpecificBackend and vice versa, because the interface and factory dependences go either direction.
It'd also be worthwhile to look at how LLVM solves this problem with its backends, since LLVM usually does things The Right Way.
Right now we have to explicitly add all supported backends to switch tables in createBackend (and createDeviceManager). It'd be nice to use a static registry pattern (I think https://www.bfilipek.com/2018/02/factory-selfregister.html is a decent overview of this pattern) to allow backends to register their existence at startup. That will also break an annoying dependence cycle where Backend depends on DeviceSpecificBackend and vice versa, because the interface and factory dependences go either direction.
It'd also be worthwhile to look at how LLVM solves this problem with its backends, since LLVM usually does things The Right Way.