# Simultaneous development of a library and executable

**URL:** <https://discuss.ocaml.org/t/simultaneous-development-of-a-library-and-executable/16253>\
**Category:** Learning\
**Created:** [March 11, 2025, 11:20pm UTC](https://discuss.ocaml.org/t/simultaneous-development-of-a-library-and-executable/16253 "2025-03-11T23:20:15Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![cerk](https://avatars.discourse-cdn.com/v4/letter/c/a183cd/32.png) [@cerk](https://discuss.ocaml.org/u/cerk)\
**Post date:** [March 12, 2025, 10:39pm UTC](https://discuss.ocaml.org/t/simultaneous-development-of-a-library-and-executable/16253/6 "2025-03-12T22:39:57Z")

</div>

Thanks for all the responses!

> [@Chet\_Murthy](#):
>
> A different idea. I often have multiple packages I’m developing, that I need to update. S I use opam “pin add” and “pin remove” liberally.

I didn’t try `dune install` but I did try `opam pin add .` and `opam pin remove .`. But I’m experiencing the same performance issues with those commands. It appears the less I call `opam`, the better it will be for my use case.

> [@yawaramin](#):
>
> I would say it’s typical to keep the library and the executable component in the same project. Do you have a specific reason why you can’t do that?

With other programming languages I’ve used, I’ve never kept an independent library within the confines of an executable project that uses that library. If the library is inside the project, how do you handle version control for the executable and library separately? One git repository for `bin/` and one git repository for each [subdirectory library](https://discuss.ocaml.org/t/idiomatic-ocaml-dune-setup-does-lib-contain-directories/11308) in `lib/`?

> [@Leonidas](#):
>
> I would also suggest keeping the executable and the library in the same dune-project, possibly in different packages if you don’t want the library to install the executable. It’s a fairly well-supported usecase.

How would I keep the executable and library in the same dune project but in different packages? I tried searching for examples but so far have not found anything. Can you give me a pointer to information or to a dune project that is set up this way?

---

_[View the full topic](https://discuss.ocaml.org/t/simultaneous-development-of-a-library-and-executable/16253)._
