Plugin systems are great, complexity is just an unfortunate side-effect. Take 
your favourite editor for example, would you like to recompile it every time 
you install a plugin? Recompile your browser for an extension? That's just 
madness, and requires either a full reinstall for users (which leads to an 
extreme amount of versions if you want to support installing some plugins but 
not others, the combinations quickly become unmanageable) or each of your users 
need to have your entire build chain on their machines (and you need to give 
them your source code).

Instead you use a plugin system, you define some functions that can be called 
from your program, and require some functions that should exist in the program 
(like `init`, `deinit`, `processX` etc.) and allow users to write their 
extensions in whatever language they want (as long as it can interface) and 
load the plugins during runtime.

Of course WASM vs. dynamic library vs. script language all have their pros and 
cons. What we really need is better libraries/tools to create these kinds of 
systems more easily. [Genny](https://github.com/treeform/genny) seems 
promising, and I know @ElegantBeef has done some work on WASM library loading, 
but I'm not sure how this work is structured or if it is easy to reuse.

Reply via email to