SERVING THE QUANTITATIVE FINANCE COMMUNITY

 
User avatar
Cuchulainn
Posts: 59705
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

C++ Modules

May 17th, 2014, 8:39 am

QuoteOriginally posted by: outrunClang is implementing Modules alreadyhere is a simple presentation about what it isLooks like they have rediscovered the wheel. But it is a good initiative.All this in known and used in other methodologies and languages for (many) number of years now. Modules have been around since the 60's. BTW in the link I was _unable_ to find a sharp definition of what a module is. It is a unit of deployment?? In C# it is called an assembly.One big problem is C++ does not support signals nor interfaces. I can't see how to implemenn modules without them, as least not in the way that other languages do do it.Module Interconnection Language
Last edited by Cuchulainn on May 16th, 2014, 10:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Posts: 59705
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

C++ Modules

May 17th, 2014, 9:34 am

QuoteOriginally posted by: outrunHm, I think you misunderstood. It's a refinement to header files, not a reinvention of the wheel and nothing to do with signal.Modules were proposed for C++11 but postponed because it's very important to get it right and it would have delayed C++11. I'll look op the draft.Again, a definition of module is essential, as I mentioned already. My definition: it is synonymous with .NET asembly.A module is much more than just a fancy header file, for sure.
Last edited by Cuchulainn on May 16th, 2014, 10:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Posts: 59705
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

C++ Modules

May 17th, 2014, 10:06 am

QuoteOriginally posted by: outrunQuoteOriginally posted by: CuchulainnQuoteOriginally posted by: outrunHm, I think you misunderstood. It's a refinement to header files, not a reinvention of the wheel and nothing to do with signal.Modules were proposed for C++11 but postponed because it's very important to get it right and it would have delayed C++11. I'll look op the draft.Again, a definition of module is essential, as I mentioned already. My definition: it is synonymous with .NET asembly.A module is much more than just a fancy header file, for sure.Your definition is very likely to be the wrong because you haven't studies it. You also sound a bit negative (re-read your posts)/know-it-all IMO which always irritated me. Im tolerant to such an attitude if you have studies things, but you can't be a mr know-it-all a-priori. Do a google search if you are interested in the definition, it's a widely talked about new language element. Interesting to talk about.No, I know exactly what a module is. Not being negative, just want a (mathematical) definition.
 
User avatar
Hansi
Posts: 3300
Joined: January 25th, 2010, 11:47 am

C++ Modules

May 17th, 2014, 10:06 am

Is there a summary to that draft as to what the benefits are?
 
User avatar
katastrofa
Posts: 8046
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

C++ Modules

May 17th, 2014, 10:09 am

Is this something like Fortran 90+ modules or packages in Java?How do the modules differ from static/dynamic libraries ?How are you going to use modules with temples, STL fans?a
 
User avatar
Cuchulainn
Posts: 59705
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

C++ Modules

May 17th, 2014, 10:11 am

QuoteOriginally posted by: outrunn3347 C++ modules draftQuoteModules are a mechanism to package libraries and encapsulate their implementations.They differ from the traditional approach of translation units and header files primarily inthat all entities are defined in just one place (even classes, templates, etc.). This paperproposes a module mechanism (somewhat similar to that of Modula-2) with threeprimary goals:? Significantly improve build times of large projects? Enable a better separation between interface and implementation? Provide a viable transition path for existing libraries...100% clear. This has been known for 50 years. Let's proceed.The abov list is a partial answer to Hansi's question. The .NET assemby is a suitable exemplar of a module.
Last edited by Cuchulainn on May 16th, 2014, 10:00 pm, edited 1 time in total.
 
User avatar
Polter
Posts: 2526
Joined: April 29th, 2008, 4:55 pm

C++ Modules

May 17th, 2014, 10:11 am

SG2 Module design draft now available
 
User avatar
Cuchulainn
Posts: 59705
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

C++ Modules

May 17th, 2014, 10:14 am

QuoteOriginally posted by: katastrofaIs this something like Fortran 90+ modules or packages in Java?How do the modules differ from static/dynamic libraries ?aYes! Packages are units of deployment or blocks, interfaces are groups of declaractions. Modules export interfaces (cf. .NET assembly, namespace and interfaces).QuoteHow are you going to use modules with temples, STL fans?Good question. Answer: with great difficulty (btw .NET generics and assemblies can do it!)@PolterStupid Q; how do I print your links pages as a pdf?
Last edited by Cuchulainn on May 16th, 2014, 10:00 pm, edited 1 time in total.
 
User avatar
Polter
Posts: 2526
Joined: April 29th, 2008, 4:55 pm

C++ Modules

May 17th, 2014, 10:20 am

Interestingly, templates are precisely the main rationale behind the module system (given that templates are the main tool of C++ and the (May 2014, linked above) proposal authors' are well-aware of that it's not exactly something that can be "overlooked" ;]):QuoteThe lack of direct language support for componentization of C++ libraries and programs, combined with increasing use of templates, has led to serious impedimentsto compile-time scalability, programmer productivity. It is the source of lackluster build performance and poor integration with cloud and distributed build systems.Furthermore, the heavy-reliance on header files inclusion (i.e. copy-and-paste from compilers? perspective) and macros stifle flowering of C++ developer tools in in-creasingly semantics-aware development environments and programming tools.It's also the reason to switch from the copy-and-paste model to a pre-computation model:QuoteStandard C++?s compilation model of templates relies on copy-and-paste of theirdefinitions in each translation unit that needs their instantiations. With the moduleownership principle, each exported declaration of a template is made available forimporting translation units.As ever the two-phase name lookup applies whether a template definition isexported or not.QuoteThis provides a mechanism for template authors to "pre-compute"common instantiations and share them across translation unit. Notice that this haseffects similar to a C++11-style extern declaration of a specialization combinedwith an explicit instantiation in an appropriate translation unit.
 
User avatar
Polter
Posts: 2526
Joined: April 29th, 2008, 4:55 pm

C++ Modules

May 17th, 2014, 10:24 am

Cuch: click "Download" (instead of clicking "View") -- just below the icon for the "spec.pdf" attachment.
 
User avatar
Cuchulainn
Posts: 59705
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

C++ Modules

May 17th, 2014, 10:33 am

QuoteOriginally posted by: PolterSG2 Module design draft now availableTried download options. Gives error message 'Cannot download from google groups, cache...".
ABOUT WILMOTT

PW by JB

Wilmott.com has been "Serving the Quantitative Finance Community" since 2001. Continued...


Twitter LinkedIn Instagram

JOBS BOARD

JOBS BOARD

Looking for a quant job, risk, algo trading,...? Browse jobs here...


GZIP: On