# Choosing from multiple packages with similar functionality

**URL:** <https://discuss.ocaml.org/t/choosing-from-multiple-packages-with-similar-functionality/10741>\
**Category:** Ecosystem\
**Created:** [November 1, 2022, 5:05am UTC](https://discuss.ocaml.org/t/choosing-from-multiple-packages-with-similar-functionality/10741 "2022-11-01T05:05:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alan](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@alan](https://discuss.ocaml.org/u/alan)\
**Post date:** [November 1, 2022, 5:05am UTC](https://discuss.ocaml.org/t/choosing-from-multiple-packages-with-similar-functionality/10741/1 "2022-11-01T05:05:06Z")

</div>

For my package `plist-xml`, I used the package `markup` for the underlying XML streaming parser. However, the `xmlm` package, another XML streaming parser, seems to be more widely used. ([The author of `markup` even recommended using `xmlm` for most use cases.](https://discuss.ocaml.org/t/which-xml-libraries-do-you-recommend/1535/4)) But, the specific project I was making used `lambdasoup`, which depended on `markup`, so for my specific situation, using `markup` made sense to share a common dependency. However, suppose someone were to depend on my package, and also depend on `xmlm` (possibly as a transitive dependency of another package). Then, using `xmlm` would have allowed that person to minimize dependencies, but because I used `markup`, that person’s code would have two packages that have similar functionality in the same compiled code.

So, if I wanted my package `plist-xml` to be more useful to other people, should I rewrite it to use `xmlm`, since it is more widely used as a dependency? Or, should I publish a new package that uses `xmlm`, even though the majority of the code would be shared with the code of `plist-xml`? Or am I overthinking things, and my choice of dependency really doesn’t matter for making my library useful for other people?

This example isn’t the only case in the OCaml ecosystem where there are multiple packages that have a similar purpose. I wonder if anyone else had a similar dilemma where there were multiple dependencies to choose from, and how you decided which dependency to use?

---

<div class="post-metadata">

**Author:** ![Leonidas](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/leonidas/32/4039_2.png) [@Leonidas](https://discuss.ocaml.org/u/Leonidas)\
**Post date:** [November 1, 2022, 9:12am UTC](https://discuss.ocaml.org/t/choosing-from-multiple-packages-with-similar-functionality/10741/2 "2022-11-01T09:12:05Z")

</div>

The main question here is whether you expose the `xmlm` or `markup` types through your API. If you don’t then it doesn’t matter much. There might be some dependency duplication but these libraries aren’t all that big nor have they that many dependencies to be a problem.

I would probably use `xmlm` because there is no need for the error-recovery of `markup` but would I rewrite an already implemented code if there is no issue with `markup`? Most likely not.
