1 / 15

Generative Programming and Active Libraries

Generative Programming and Active Libraries. Krzysztof Czarnecki DaimlerChrysler Research and Technology Software Engineering Lab Ulm, Germany www.generative-programming.org. The Vision. Think & program “one of a kind” programming Survey & assembly component-based programming

francislin
Télécharger la présentation

Generative Programming and Active Libraries

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Generative Programming and Active Libraries Krzysztof Czarnecki DaimlerChrysler Research and Technology Software Engineering Lab Ulm, Germany www.generative-programming.org

  2. The Vision • Think & program • “one of a kind” programming • Survey & assembly • component-based programming • Order & generate • generative programming

  3. Component-Based Programming • Example: Standard Template Library (STL) • As set of basic, carefully factored data container and algorithm components (minimum redundancy, maximum combinability and reuse) • stack<Element,list<Element> > • Problem of manual assembly in STL • extensive knowledge of implementation detail needed • implementation components, illegal & optimal configurations • poor error reporting

  4. Example of an STL Usage Error stl_algo.h: In function ‘void __merge_sort_loop<_List_iterator <foo,foo &,foo *>, foo *, int>(_List_iterator<foo,foo &,foo *>, _List_iterator<foo,foo &,foo *>, foo *, int)’: stl_algo.h:1448: instantiated from ‘__merge_sort_with_buffer <_List_iterator<foo,foo &,foo *>, foo *, int>( _List_iterator<foo,foo &,foo *>, _List_iterator<foo,foo &,foo *>, foo *, int *)’ stl_algo.h:1485: instantiated from ‘__stable_sort_adaptive< _List_iterator<foo,foo &,foo *>, foo *, int>(_List_iterator <foo,foo &,foo *>, _List_iterator<foo,foo &,foo *>, foo *, int)’ stl_algo.h:1524: instantiated from here stl_algo.h:1377: no match for ‘_List_iterator<foo,foo &,foo *> & -_ ...

  5. Generative Programming The programmer states what she needs... LIST_GENERATOR<Person,cp,poly,with_counter>::RET ACCOUNT_GENERATOR<credit,EUR>::RET MATRIX_GENERATOR<double,structure<up_triang>,speed >::RET and gets the desired component!

  6. Active Libraries • The idea of putting compile-time metacode into domain-specific libraries • Active libraries – in addition to classes and functions – also contain metacode for configuration, generation, optimization, error reporting, debugging and profiling, editing and visualization of code, code refactoring, versioning, ... • Extensible programming environments • e.g. Intentional Programming (Microsoft Research)

  7. Extensible Programming Environments L3 L2 L2 L6 EPE1 EPE2 L3 L1 L4 L5 L2 L6 L5 L1 L4 L3 EPE = Extensible Programming Environment L = Active Library ( compilation,  debugging,  rendering,  type-in & editing,  refactoring...)

  8. Active Library for Matrix Computation

  9. Generative Domain Model • Configuration Knowledge • Illegal feature combinations • Default settings • Default dependencies • Construction rules • Optimizations • Problem Space • Domain-specificconcepts and • Features • Solution Space • Elementarycomponents • Maximumcombinability • Minimumredundancy Components +System FamilyArchitecture Domain SpecificLanguages (DSLs) Generators

  10. System Family Approach • Domain Engineering • analysis: scoping, common and variable features, feature dependencies (FODA feature diagrams) • design: common architecture for the system family domain-specific languages, configuration generators • implementation: reusable components, domain-specific languages, configuration generators • Application Engineering • production of concrete, highly customized systems and components using the above-mentioned results

  11. Further Information • Czarnecki, Eisenecker: Generative Programming - Methods, Tools, and Applications, Addison-Wesley, 2000 • www.generative-programming.org • Generative and Component-Based Software Development (GCSE 2000), October 10 - 12, 2000, Erfurt, Germany, www.netobjectdays.org/gcse

  12. Industrial Revolution 1980s automated assembly lines first industrial robot installed in 1961 at General Motors; 1970’s advance of microchips 1901 assembly lines introducedby Ransom Olds; popularized and refined by Henry Ford in 1913 1826 interchangeable parts successfully introduced by John Hall (after 25 years of unsuccessful attempts!)

  13. Industrializing Software Production Generating the needed componentsand automatic assembly Generative Programming • Product-Line • Engineering • FODA, ODM, etc. • Better composition automation • active libs, extendible programming environments (e.g. IP), etc. Current practice Searching for and adapting componentsand manual assembly • Better composition technologies • AOP, SOP, APPC, CFs, etc.

  14. Issues to discuss... • DSL design • composability of DSLs

  15. Workshop Issues • Industrial Experiences: experiences with generative techniques for product lines in industrial settings • hard problems in industrial settings that research needs to address • organizational and other problems in industrial settings (how to install and successfully run generative technology projects) • Properties and Design of Domain-Specific Languages DSLs: composability of DSLs • adaptability and parameterization of DSLs • textual vs. GUI DSLs • wizards vs. more complex modeling languages • Approaches to generation: classification of different approaches to generation • properties of a generator architecture • pros and cons of different generative technologies and when to apply which • Approaches to developing generative models: Domain Engineering • Jargons • experiences and managing the process in industrial settings

More Related