Question to implementers: Moduels vs libraries

113 views
Skip to first unread message

Loïc Joly

unread,
Mar 14, 2018, 12:30:58 PM3/14/18
to mod...@isocpp.org
Hello,

I know the language does not have the notion of library. But every
compiler has some. And I wondering if there is any interaction between
your implementation of modules and the notion of library, or if both are
totally orthogonal. More specifically:

- Can different module units of a unique named module be grouped into
several different libraries (static or dynamic, if that changes anything)?

- Can a single library (static or dynamic) contain module units from
different named modules?


---

Loïc



Richard Smith

unread,
Mar 14, 2018, 12:50:25 PM3/14/18
to mod...@isocpp.org
On Wed, 14 Mar 2018, 12:30 Loïc Joly, <loic.act...@numericable.fr> wrote:
Hello,

I know the language does not have the notion of library. But every
compiler has some. And I wondering if there is any interaction between
your implementation of modules and the notion of library, or if both are
totally orthogonal.

(Talking about the clang implementation below.)

More specifically:

- Can different module units of a unique named module be grouped into
several different libraries (static or dynamic, if that changes anything)?

Currently yes. We have considered giving module-linkage entities hidden visibility by default (which would mean you get better codegen but that a module can't span a dynamic library boundary -- unless you turn that feature off), but the current language rules make that tricky or infeasible -- particularly, a template defined in the module but instantiated outside might refer to a module linkage symbol.

- Can a single library (static or dynamic) contain module units from
different named modules?

Yes.

---

Loïc



--
You received this message because you are subscribed to the Google Groups "SG2 - Modules" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modules+u...@isocpp.org.
To post to this group, send email to mod...@isocpp.org.
Visit this group at https://groups.google.com/a/isocpp.org/group/modules/.

Loïc Joly

unread,
Mar 15, 2018, 6:43:26 AM3/15/18
to mod...@isocpp.org
Thank you Richard for this information.

Any feedback from VC++/GCC?

---
Loïc Joly


Le 14/03/2018 à 17:50, 'Richard Smith' via SG2 - Modules a écrit :
> On Wed, 14 Mar 2018, 12:30 Loïc Joly,
> <loic.act...@numericable.fr
Reply all
Reply to author
Forward
0 new messages