# Plugin-system for OCaml programs

**URL:** <https://discuss.ocaml.org/t/plugin-system-for-ocaml-programs/9048>\
**Category:** Learning\
**Tags:** language\
**Created:** [December 22, 2021, 6:34am UTC](https://discuss.ocaml.org/t/plugin-system-for-ocaml-programs/9048 "2021-12-22T06:34:25Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![gndl](https://avatars.discourse-cdn.com/v4/letter/g/58f4c7/32.png) [@gndl](https://discuss.ocaml.org/u/gndl)\
**Post date:** [December 22, 2021, 6:01pm UTC](https://discuss.ocaml.org/t/plugin-system-for-ocaml-programs/9048/10 "2021-12-22T18:01:11Z")

</div>

As @nojb said, Dynlink is a suitable tool for this feature.  
If plugins need ad hoc polymorphism, the natural way is to use OOP (this is what I do in [Graffophone](https://github.com/gndl/graffophone/blob/main/src/pluginsManager.ml)). However, It may be possible to use [Kantian’s solution](https://discuss.ocaml.org/t/the-shape-design-problem/7810/8).

---

_[View the full topic](https://discuss.ocaml.org/t/plugin-system-for-ocaml-programs/9048)._
