Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't force static libs #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

autoantwort
Copy link
Contributor

Or are they somehow required?

@ChristianPanov
Copy link
Owner

I've made it static because it makes more sense given the library's purpose and design. It’s fairly small and heavily relies on templates, so most of the work is done at compile time. With a static library, all the templates are resolved when you build your project, which means there’s no extra overhead at runtime, you get the benefit of no runtime indirection, such as resolving symbols from a dynamic library.

Sure, you could argue that it will be most sensible to allow the user to choose whether it is built as a static lib or dynamic lib, but that carries it's negatives. It means increased maintenance. Bugs might surface only in one version, requiring additional effort to debug and fix. Build configurations can become more complex. For example, you may need separate CMake options, different installation procedures, and separate considerations for things like symbol visibility in dynamic libraries.
Also, the library being template-heavy introduces its own challenges if its a shared library. Templates are instantiated at compile time, so users of the dynamic library would only have access to explicitly instantiated templates or would need headers anyway, which in a way reduces the value of the dynamic library. This will be hell because I will most likely need to completely rethink some of the decisions I've made regarding the templates.

If there is another point of view that I'm missing(very likely), I'll be glad to hear it. Because I am certainly biased by my own use cases and it's likely there is something I'm not taking into account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants