Backends should have names and parseable parameters, not enums and void * hacks
From the Hammer road map (originally of Sep. 2017, later largely incorporated into the SafeDocs proposal):
(4) Finish name/parameter for backends patch
...
(6) Abolish backend enum, use vtable pointers (depends on (4))
(7) Implement loadable backend modules (depends on (4), (6))
We have a parser we can easily deploy to parse textual parameters passed to itself, but we awkwardly cast things into void pointers like h_compile(p, PB_GLR, (void *)1)
- why can't we say things like h_compile(p, h_get_backend("glr(1)"))
instead?
Furthermore, we eventually want to put backends in loadable modules, and perhaps even support backends that build outside the official Hammer tree or are maintained by third parties. The current system of identifying backends by enum values is bound to lead to conflicts in that scenario. We should move toward a model where backends are referred to by vtable pointers and queried by names or name/parameter strings to avoid this.