180 likes | 338 Views
Lessons from Generative Techniques at Lucent Technologies. Lloyd H. Nakatani Avaya Labs Murray Hill, New Jersey lhn@avaya.com Mark Ardis Rose-Hulman Institute of Technology Terre Haute, Indiana Mark.A.Ardis@Rose-Hulman.edu. Three Lessons for DSLs. 1. Composability 2. Composability
E N D
Lessons from Generative Techniques at Lucent Technologies Lloyd H. Nakatani Avaya Labs Murray Hill, New Jersey lhn@avaya.com Mark Ardis Rose-Hulman Institute of Technology Terre Haute, Indiana Mark.A.Ardis@Rose-Hulman.edu Generative Techniques Workshop
Three Lessons for DSLs • 1. Composability • 2. Composability • 3. Composability Generative Techniques Workshop
InfoWiz: Product Line for Jargons Fit programming language and API library WizTalk syntax Jargon J Semantics S Model M Product P InfoWiz interpreter Comes with InfoWiz (commonalities) Created by user (variabilities) Generative Techniques Workshop
Example: Procedural Jargon • For modeling algorithms ;=height[;input[Enter your height: ]] ;if( ;.height > 72 ) ;output[Taller;cr] ;else( ;.height > 64 ) ;output[Medium;cr] ;else ;output[Short;cr] Generative Techniques Workshop
Example: Data Jargon • For modeling hierarchical data ;person ;name ;first[Alan] ;last[Turing] ;address ;street[600 Mountain Ave.] ;town[Murray Hill] ;state[NJ] ;zip[07974] ;phone(work)[908/582-1234] Generative Techniques Workshop
Example: Markup Jargon • For modeling text format ;p This is ;i[italic], this is ;b[bold], and this is ;s(16)[big]. Generative Techniques Workshop
J1 J2 J3 Jargon Composition S1 S2 S3 InfoWiz interpreter P Composite model Generative Techniques Workshop
Example: Composite Model • ;=person ;name ;first[Alan] ;last[Turing] ;if( [a-z] ~ ;.person(name|first) ) ;output Hello ;i[;.person(name|first)];cr ;else ;output[No name;cr] Generative Techniques Workshop
J2 J1 M1 M2 Domain Engineering with Jargons Decompose Model Compose S1 S2 Subdomain D1 Domain model InfoWiz interpreter P Domain Subdomain D2 Generative Techniques Workshop
Reconfiguration algorithms Example: Domain and Subdomains 5ESS Configuration Control Domain Hardware units and configuration Target data structures Generative Techniques Workshop
Algorithm model S J Virtual Finite State Machine C code Reconfiguration Algorithms • ;realization(remove) • ;chk(cond,self,working) • ;chk(cond,spare_mate,ready) • ;invoke[elevate:spare_mate] • ;invoke[delevate:self] • ;invoke[remove:child] • ;chk(result,abortORfail) • ;set(ack)[fail,remove_child] • ;skipexps[endreal] • ;invoke[inhibit:self] • ;send[hardware:remove • ;chk(result,fail) • ;set(ack)[fail,remove] • ;invoke[allow:self] • ;skipexps[endreal] • ;set(cond)[remove] • ;set(ack)[success] • ;send[rmtce:remove] • ;skipend[endreal] • ;send[ack] • ;end 21 lines InfoWiz interpreter 2423 lines VFSM code generator 3505 lines Generative Techniques Workshop
S C data structure code Configuration model Hardware Units and Configuration Visual modeling tool • . • . • . • . • . • . 642 lines InfoWiz interpreter 589 lines Generative Techniques Workshop
RAD Visual Modeling Tool Generative Techniques Workshop
Divide and Conquer Domains Generative Techniques Workshop
Composition of Subdomain Models Generative Techniques Workshop
Subdomain A1 Subdomain B1 Subdomain A2 Subdomain B2 Subdomain A3 Subdomain C1 Subdomain C2 Subdomain C3 Teamwork Today Domain A Domain B Domain C Generative Techniques Workshop
Subdomain B1 Subdomain B2 Subdomain A1 Subdomain C1 Subdomain C2 Teamwork Tomorrow SuperdomainS Domain B Domain A Subdomain A2 Subdomain A3 Domain C Subdomain C3 Generative Techniques Workshop
Conclusions for Generative DSLs • Multiple DSLs per domain, so they must be ... • easy to make and maintain • composable • to support divide-and-conquer • to scale up in complexity • We walked our own talk and made generative DSLs a product line Generative Techniques Workshop