SlideShare a Scribd company logo
1 of 15
Download to read offline
Source­to­source 
transformations 
Supporting tools and infrastructure 
Nikolaos Kavvadias 
nkavv@uop.gr 
March 31st, 2009 
Nikolaos Kavvadias nkavv@uop.gr Source­to­source 
transformations
Source­to­source 
transformation (1) 
By the term ‘‘source­to­source 
transformation’’ we refer to 
any mechanism that when applied to a SOURCE program, a 
functionally equivalent TARGET program is produced 
Basic assumptions 
SOURCE and TARGET programs submit to the same 
programming language semantics 
A ‘‘database’’ of the source program is generated by 
translating to a form of high­level 
intermediate 
representation (HIR) 
The target program is produced by pretty­printing 
the HIR 
view of the source program 
Secondary assumptions 
Structural information (e.g. program layout, line numbers) 
may not be preserved when translating to the HIR form 
Nikolaos Kavvadias nkavv@uop.gr Source­to­source 
transformations
Source­to­source 
transformation (2) 
Potential uses of source­to­source 
(also termed as 
‘‘source­level’’) 
transformations 
Algebraic and other simplifications (e.g. matrix flattening) 
Data access improvements for enhancing data locality 
Enforcing the use of a data memory hierarchy (data reuse 
transformations) 
Conversion to a standard (canonicalized) form 
Enabling the application of lower level transformations 
(closer to the underlying machine model) 
High­level 
view of the source­to­source 
translation process 
Nikolaos Kavvadias nkavv@uop.gr Source­to­source 
transformations
Pragmatics of a source­to­source 
transformation 
framework 
Useful software facilities for implementing a 
source­to­source 
transformation framework 
AST builder and walker 
AST/HIR query engine 
Semantics checker and/or HIR validator 
AST2HIR and HIR2AST modules 
Z In general, comprehensive frontend facilities would be 
extremely useful to build upon 
Nikolaos Kavvadias nkavv@uop.gr Source­to­source 
transformations
An overview of tools and infrastructure 
Existing software systems 
The C­to­C 
source code translator 
(ftp://theory.lcs.mit.edu/pub/c2c/), now defunct 
Memphis tree builder and walker tool 
(http://memphis.compilertools.net/index.html) 
EDG C/C++ frontend (http://www.edg.com) 
TXL (http://www.txl.ca) 
The Cetus project (http://cetus.ecn.purdue.edu/) 
ROSE compiler infrastructure 
(http://www.rosecompiler.org) 
. . . or ‘‘Roll Your Own’’ system/infrastructure 
Based on extensible text transformation technology: XML + 
XSLT (http://www.w3.org/2001/XMLSchema) 
Adapt to exactly fit your needs 
Nikolaos Kavvadias nkavv@uop.gr Source­to­source 
transformations
The C­to­C 
MIT source code translation tool 
Features 
AST building and type checking from ANSI C 
Data flow analysis on the AST 
MIT license 
Cons 
Relatively few built­in 
transformations 
Further development has ceased 
Distribution site now defunct (as of late 2005) 
Suggestions 
Lack of features and support prevent C2C from being a 
reliable infrastructure 
Nikolaos Kavvadias nkavv@uop.gr Source­to­source 
transformations
Memphis 
Characteristics and features 
Intended audience are compiler writers 
Provides basic mechanisms for rule­based 
tree 
transformations 
Works well with Lex and Yacc 
Memphis personal license + GPL 
Cons 
Lack of a ready­to­use 
C grammar 
No real world examples 
Largely unknown to the community 
Development site ceased (http://www.combo.org) 
Suggestions 
Infrastructure is only minimal and not really useful for any 
practical use 
Nikolaos Kavvadias nkavv@uop.gr Source­to­source 
transformations
EDG C/C++ frontend 
Features 
Mature and complete C/C++ frontend 
Covers the entire C99 and latest C++ standards 
AST construction and a rich set of related data structures 
Extensive documentation ( 600 pages) 
Actively supported by a company (Edison Design Group) 
Proprietary open­source 
license; free for academic research 
Cons 
Developing user tools requires a significant time investment 
No API (which would simplify the development of extensions 
and plugins) 
Suggestions 
Viable choice in case infrastructure development time is 
more or less irrelevant 
Nikolaos Kavvadias nkavv@uop.gr Source­to­source 
transformations
TXL 
Features 
TXL is a functional programming language mainly used for 
domain­specific 
language development 
Language primitives for specifying tree rewriting rules 
Comes with many frontends (C, C++, Java, Modula­2/ 
3, etc) 
Has been used in production environments (source code 
transformations for eliminating patterns of code arising Y2K 
problems) 
Cons 
Development seems to be steered by a single person; no real 
community being able to contribute 
TXL is a narrow­scope 
language 
No previous experience with TXL 
Suggestions 
Viable choice only if the source transformations involved 
could be easily specified by bare bones term rewriting 
Nikolaos Kavvadias nkavv@uop.gr Source­to­source 
transformations
Cetus 
Features 
Source­to­source 
C compiler written in Java 
Extensive set of compiler passes working on a high­level 
IR 
Supports parallelization techniques 
Analyses and transformations 
Data dependence analysis 
Loop parallelizer 
Source program canonicalization 
Loop outlining (procedural abstraction of loops) 
Modified Artistic License 
Cons 
Depending on external tools (Java libraries, ANTLR) 
Very small (nonexistent?) community outside Purdue Univ. 
Suggestions 
The scope of this infrastructure seems appropriate 
Focuses on parallelism extraction for OpenMP and not loop 
restructuring transformations suitable for other purposes 
Nikolaos Kavvadias nkavv@uop.gr Source­to­source 
transformations
ROSE 
Features 
A C++ tool for building source­to­source 
translators 
Support for C, C99, UPC, C++, Fortran 77­90/ 
95­2003 
Builds upon the EDG frontend (included) 
Under active development 
Analyses and transformations 
AST construction, traversal and querying, CFG construction, 
data flow analyses 
Predefined loop optimizations: loop interchange, loop fusion, 
loop fission, loop splitting, loop unrolling 
Revised BSD license 
Cons 
External dependencies (Java, compiled version of Boost) 
It is unclear whether there is an active community yet 
Suggestions 
Scope and purpose of this infrastructure seem appropriate 
Heavy work for an EDG­based 
ecosystem already done 
Nikolaos Kavvadias nkavv@uop.gr Source­to­source 
transformations
Custom text transformation engine based on XML 
Features 
XML is a well­established 
and mature technology 
Provides the means for specifying your own text 
manipulation and transformation primitives 
Vast community of developers and users 
Cons 
Development of the infrastructure: constructors, traversals, 
querying mechanisms, pretty­printers, 
dumping to debugging 
formats, fundamental analyses and transformations 
Development effort cannot be easily estimated 
Suggestions 
XML is a tool for serious work given that the development 
project is closely managed in respect to timeframes and 
human resources 
Nikolaos Kavvadias nkavv@uop.gr Source­to­source 
transformations
Conclusion 
There exist viable solutions for creating a source­to­source 
translation tool fitting our needs 
EDG: roll your own analyses and transformations 
XML: roll your own and customize to your specific needs 
ROSE: open and extensible infrastructure based on the EDG 
frontend 
The choice of one of these solutions requires taking into 
account subjective factors such as: 
Communication of ideas, concepts and results to and from 
other parties involved 
Extensibility of the infrastructure 
Preexisting knowledge 
Personal preference 
Nikolaos Kavvadias nkavv@uop.gr Source­to­source 
transformations
References I 
TXL homepage. http://www.txl.ca 
Memphis tree builder and walker. 
http://memphis.compilertools.net/index.html 
The C­to­C 
source code translator. 
ftp://theory.lcs.mit.edu/pub/c2c/ 
The EDG C/C++ frontend. http://www.edg.com 
The Cetus project. http://cetus.ecn.purdue.edu 
ROSE: A tool for building source­to­source 
translators. 
http://www.rosecompiler.org 
Nikolaos Kavvadias nkavv@uop.gr Source­to­source 
transformations
Revision history 
v0.1 (30/03/2009): Initial version 
Nikolaos Kavvadias nkavv@uop.gr Source­to­source 
transformations

More Related Content

What's hot

How to get started with R programming
How to get started with R programmingHow to get started with R programming
How to get started with R programmingRamon Salazar
 
Adopting the DSM paradigm: defining federation scenarios through resource br...
Adopting the DSM paradigm: defining federation scenarios through resource br...Adopting the DSM paradigm: defining federation scenarios through resource br...
Adopting the DSM paradigm: defining federation scenarios through resource br...Christos Tranoris
 
LarKC Tutorial at ISWC 2009 - Parallelisation
LarKC Tutorial at ISWC 2009 - ParallelisationLarKC Tutorial at ISWC 2009 - Parallelisation
LarKC Tutorial at ISWC 2009 - ParallelisationLarKC
 
R Introduction
R IntroductionR Introduction
R Introductionschamber
 
Semantic Web use cases in outcomes research
Semantic Web use cases in outcomes researchSemantic Web use cases in outcomes research
Semantic Web use cases in outcomes researchChimezie Ogbuji
 
Comparative Study That Aims Rdf Processing For The Java Platform
Comparative Study That Aims Rdf Processing For The Java PlatformComparative Study That Aims Rdf Processing For The Java Platform
Comparative Study That Aims Rdf Processing For The Java PlatformComputer Science
 
Expressive Querying of Semantic Databases with Incremental Query Rewriting
Expressive Querying of Semantic Databases with Incremental Query RewritingExpressive Querying of Semantic Databases with Incremental Query Rewriting
Expressive Querying of Semantic Databases with Incremental Query RewritingAlexandre Riazanov
 
Scala Overview INFX 1616
Scala Overview INFX 1616Scala Overview INFX 1616
Scala Overview INFX 1616Patrick Walter
 
R programming slides
R  programming slidesR  programming slides
R programming slidesPankaj Saini
 
R Programming Overview
R Programming Overview R Programming Overview
R Programming Overview dlamb3244
 
An Approach for the Incremental Export of Relational Databases into RDF Graphs
An Approach for the Incremental Export of Relational Databases into RDF GraphsAn Approach for the Incremental Export of Relational Databases into RDF Graphs
An Approach for the Incremental Export of Relational Databases into RDF GraphsNikolaos Konstantinou
 

What's hot (16)

How to get started with R programming
How to get started with R programmingHow to get started with R programming
How to get started with R programming
 
Sinux
SinuxSinux
Sinux
 
10 xrd-software
10 xrd-software10 xrd-software
10 xrd-software
 
Introduction To Pentaho Kettle
Introduction To Pentaho KettleIntroduction To Pentaho Kettle
Introduction To Pentaho Kettle
 
Adopting the DSM paradigm: defining federation scenarios through resource br...
Adopting the DSM paradigm: defining federation scenarios through resource br...Adopting the DSM paradigm: defining federation scenarios through resource br...
Adopting the DSM paradigm: defining federation scenarios through resource br...
 
LarKC Tutorial at ISWC 2009 - Parallelisation
LarKC Tutorial at ISWC 2009 - ParallelisationLarKC Tutorial at ISWC 2009 - Parallelisation
LarKC Tutorial at ISWC 2009 - Parallelisation
 
R Introduction
R IntroductionR Introduction
R Introduction
 
Semantic Web use cases in outcomes research
Semantic Web use cases in outcomes researchSemantic Web use cases in outcomes research
Semantic Web use cases in outcomes research
 
Comparative Study That Aims Rdf Processing For The Java Platform
Comparative Study That Aims Rdf Processing For The Java PlatformComparative Study That Aims Rdf Processing For The Java Platform
Comparative Study That Aims Rdf Processing For The Java Platform
 
Expressive Querying of Semantic Databases with Incremental Query Rewriting
Expressive Querying of Semantic Databases with Incremental Query RewritingExpressive Querying of Semantic Databases with Incremental Query Rewriting
Expressive Querying of Semantic Databases with Incremental Query Rewriting
 
Scala Overview INFX 1616
Scala Overview INFX 1616Scala Overview INFX 1616
Scala Overview INFX 1616
 
R programming slides
R  programming slidesR  programming slides
R programming slides
 
LSESU a Taste of R Language Workshop
LSESU a Taste of R Language WorkshopLSESU a Taste of R Language Workshop
LSESU a Taste of R Language Workshop
 
R Programming Overview
R Programming Overview R Programming Overview
R Programming Overview
 
L15 Data Source Layer
L15 Data Source LayerL15 Data Source Layer
L15 Data Source Layer
 
An Approach for the Incremental Export of Relational Databases into RDF Graphs
An Approach for the Incremental Export of Relational Databases into RDF GraphsAn Approach for the Incremental Export of Relational Databases into RDF Graphs
An Approach for the Incremental Export of Relational Databases into RDF Graphs
 

Viewers also liked

Thevenin norton_ECA
Thevenin norton_ECAThevenin norton_ECA
Thevenin norton_ECAShariq Alee
 
Langkah mencari litar setara norton thevenin guna source transformation
Langkah mencari litar setara norton thevenin guna source transformationLangkah mencari litar setara norton thevenin guna source transformation
Langkah mencari litar setara norton thevenin guna source transformationsf c
 
B tech ee ii_ eee_ u-2_ ac circuit analysis_dipen patel
B tech ee  ii_ eee_ u-2_ ac circuit analysis_dipen patelB tech ee  ii_ eee_ u-2_ ac circuit analysis_dipen patel
B tech ee ii_ eee_ u-2_ ac circuit analysis_dipen patelRai University
 
Diploma i boee u 3 ac circuit analysis
Diploma i boee u 3 ac circuit analysisDiploma i boee u 3 ac circuit analysis
Diploma i boee u 3 ac circuit analysisRai University
 
PROGRAMMABLE LOGIC CONTROLLERS
PROGRAMMABLE LOGIC CONTROLLERSPROGRAMMABLE LOGIC CONTROLLERS
PROGRAMMABLE LOGIC CONTROLLERSRAHUL DESHMUKH
 
Circuit Theorem
Circuit TheoremCircuit Theorem
Circuit Theoremstooty s
 
Star delta
Star deltaStar delta
Star deltaavi1001
 
Delta star relationship (1)
Delta star relationship (1)Delta star relationship (1)
Delta star relationship (1)140120109032
 
Topic 2a ac_circuits_analysis
Topic 2a ac_circuits_analysisTopic 2a ac_circuits_analysis
Topic 2a ac_circuits_analysisGabriel O'Brien
 
AC electricity
AC electricityAC electricity
AC electricitynlahoud
 
Ac circuits 15 april 2013(1)
Ac circuits 15 april 2013(1)Ac circuits 15 april 2013(1)
Ac circuits 15 april 2013(1)Malusela Ndivhuwo
 
Ac fundamentals
Ac fundamentalsAc fundamentals
Ac fundamentalsAnu71
 

Viewers also liked (16)

bhandout
bhandoutbhandout
bhandout
 
Thev norton eq
Thev norton eqThev norton eq
Thev norton eq
 
Thevenin norton_ECA
Thevenin norton_ECAThevenin norton_ECA
Thevenin norton_ECA
 
Langkah mencari litar setara norton thevenin guna source transformation
Langkah mencari litar setara norton thevenin guna source transformationLangkah mencari litar setara norton thevenin guna source transformation
Langkah mencari litar setara norton thevenin guna source transformation
 
B tech ee ii_ eee_ u-2_ ac circuit analysis_dipen patel
B tech ee  ii_ eee_ u-2_ ac circuit analysis_dipen patelB tech ee  ii_ eee_ u-2_ ac circuit analysis_dipen patel
B tech ee ii_ eee_ u-2_ ac circuit analysis_dipen patel
 
Ac single phase
Ac single phaseAc single phase
Ac single phase
 
Diploma i boee u 3 ac circuit analysis
Diploma i boee u 3 ac circuit analysisDiploma i boee u 3 ac circuit analysis
Diploma i boee u 3 ac circuit analysis
 
PROGRAMMABLE LOGIC CONTROLLERS
PROGRAMMABLE LOGIC CONTROLLERSPROGRAMMABLE LOGIC CONTROLLERS
PROGRAMMABLE LOGIC CONTROLLERS
 
Circuit Theorem
Circuit TheoremCircuit Theorem
Circuit Theorem
 
Star delta
Star deltaStar delta
Star delta
 
Delta star relationship (1)
Delta star relationship (1)Delta star relationship (1)
Delta star relationship (1)
 
Topic 2a ac_circuits_analysis
Topic 2a ac_circuits_analysisTopic 2a ac_circuits_analysis
Topic 2a ac_circuits_analysis
 
Network Theorems.ppt
Network Theorems.pptNetwork Theorems.ppt
Network Theorems.ppt
 
AC electricity
AC electricityAC electricity
AC electricity
 
Ac circuits 15 april 2013(1)
Ac circuits 15 april 2013(1)Ac circuits 15 april 2013(1)
Ac circuits 15 april 2013(1)
 
Ac fundamentals
Ac fundamentalsAc fundamentals
Ac fundamentals
 

Similar to Source-to-source transformations: Supporting tools and infrastructure

Pattern-Oriented Distributed Software Architectures
Pattern-Oriented Distributed Software Architectures Pattern-Oriented Distributed Software Architectures
Pattern-Oriented Distributed Software Architectures David Freitas
 
Software Abstractions for Parallel Hardware
Software Abstractions for Parallel HardwareSoftware Abstractions for Parallel Hardware
Software Abstractions for Parallel HardwareJoel Falcou
 
Lviv Data Science Club (Sergiy Lunyakin)
Lviv Data Science Club (Sergiy Lunyakin)Lviv Data Science Club (Sergiy Lunyakin)
Lviv Data Science Club (Sergiy Lunyakin)Lviv Startup Club
 
Next-Generation Completeness and Consistency Management in the Digital Threa...
Next-Generation Completeness and Consistency Management in the Digital Threa...Next-Generation Completeness and Consistency Management in the Digital Threa...
Next-Generation Completeness and Consistency Management in the Digital Threa...Ákos Horváth
 
Realizing the promise of portable data processing with Apache Beam
Realizing the promise of portable data processing with Apache BeamRealizing the promise of portable data processing with Apache Beam
Realizing the promise of portable data processing with Apache BeamDataWorks Summit
 
FredMcLainResumeB
FredMcLainResumeBFredMcLainResumeB
FredMcLainResumeBFred McLain
 
IncQuery_presentation_Incose_EMEA_WSEC.pptx
IncQuery_presentation_Incose_EMEA_WSEC.pptxIncQuery_presentation_Incose_EMEA_WSEC.pptx
IncQuery_presentation_Incose_EMEA_WSEC.pptxIncQuery Labs
 
Developing With Openbravo Rl Eppt
Developing With Openbravo Rl EpptDeveloping With Openbravo Rl Eppt
Developing With Openbravo Rl Epptvobree
 
Building and deploying LLM applications with Apache Airflow
Building and deploying LLM applications with Apache AirflowBuilding and deploying LLM applications with Apache Airflow
Building and deploying LLM applications with Apache AirflowKaxil Naik
 
2014 01-ticosa
2014 01-ticosa2014 01-ticosa
2014 01-ticosaPharo
 
Dotnetintroduce 100324201546-phpapp02
Dotnetintroduce 100324201546-phpapp02Dotnetintroduce 100324201546-phpapp02
Dotnetintroduce 100324201546-phpapp02Wei Sun
 
Ease of full Stack Development
Ease of full Stack DevelopmentEase of full Stack Development
Ease of full Stack DevelopmentIRJET Journal
 
(Costless) Software Abstractions for Parallel Architectures
(Costless) Software Abstractions for Parallel Architectures(Costless) Software Abstractions for Parallel Architectures
(Costless) Software Abstractions for Parallel ArchitecturesJoel Falcou
 
Present and future of unified, portable and efficient data processing with Ap...
Present and future of unified, portable and efficient data processing with Ap...Present and future of unified, portable and efficient data processing with Ap...
Present and future of unified, portable and efficient data processing with Ap...DataWorks Summit
 
Petapath HP Cast 12 - Programming for High Performance Accelerated Systems
Petapath HP Cast 12 - Programming for High Performance Accelerated SystemsPetapath HP Cast 12 - Programming for High Performance Accelerated Systems
Petapath HP Cast 12 - Programming for High Performance Accelerated Systemsdairsie
 
Simon Brown: Software Architecture as Code at I T.A.K.E. Unconference 2015
Simon Brown: Software Architecture as Code at I T.A.K.E. Unconference 2015Simon Brown: Software Architecture as Code at I T.A.K.E. Unconference 2015
Simon Brown: Software Architecture as Code at I T.A.K.E. Unconference 2015Mozaic Works
 
Perfsystems- Consulting Services
Perfsystems- Consulting ServicesPerfsystems- Consulting Services
Perfsystems- Consulting ServicesPerfsys Tems
 
Leveraging Model-Driven Technologies for JSON Artefacts: The Shipyard Case Study
Leveraging Model-Driven Technologies for JSON Artefacts: The Shipyard Case StudyLeveraging Model-Driven Technologies for JSON Artefacts: The Shipyard Case Study
Leveraging Model-Driven Technologies for JSON Artefacts: The Shipyard Case StudyLuca Berardinelli
 
LarKC Tutorial at ISWC 2009 - Introduction
LarKC Tutorial at ISWC 2009 - IntroductionLarKC Tutorial at ISWC 2009 - Introduction
LarKC Tutorial at ISWC 2009 - IntroductionLarKC
 

Similar to Source-to-source transformations: Supporting tools and infrastructure (20)

Pattern-Oriented Distributed Software Architectures
Pattern-Oriented Distributed Software Architectures Pattern-Oriented Distributed Software Architectures
Pattern-Oriented Distributed Software Architectures
 
Software Abstractions for Parallel Hardware
Software Abstractions for Parallel HardwareSoftware Abstractions for Parallel Hardware
Software Abstractions for Parallel Hardware
 
Lviv Data Science Club (Sergiy Lunyakin)
Lviv Data Science Club (Sergiy Lunyakin)Lviv Data Science Club (Sergiy Lunyakin)
Lviv Data Science Club (Sergiy Lunyakin)
 
Next-Generation Completeness and Consistency Management in the Digital Threa...
Next-Generation Completeness and Consistency Management in the Digital Threa...Next-Generation Completeness and Consistency Management in the Digital Threa...
Next-Generation Completeness and Consistency Management in the Digital Threa...
 
Realizing the promise of portable data processing with Apache Beam
Realizing the promise of portable data processing with Apache BeamRealizing the promise of portable data processing with Apache Beam
Realizing the promise of portable data processing with Apache Beam
 
FredMcLainResumeB
FredMcLainResumeBFredMcLainResumeB
FredMcLainResumeB
 
IncQuery_presentation_Incose_EMEA_WSEC.pptx
IncQuery_presentation_Incose_EMEA_WSEC.pptxIncQuery_presentation_Incose_EMEA_WSEC.pptx
IncQuery_presentation_Incose_EMEA_WSEC.pptx
 
Developing With Openbravo Rl Eppt
Developing With Openbravo Rl EpptDeveloping With Openbravo Rl Eppt
Developing With Openbravo Rl Eppt
 
Building and deploying LLM applications with Apache Airflow
Building and deploying LLM applications with Apache AirflowBuilding and deploying LLM applications with Apache Airflow
Building and deploying LLM applications with Apache Airflow
 
2014 01-ticosa
2014 01-ticosa2014 01-ticosa
2014 01-ticosa
 
Dotnetintroduce 100324201546-phpapp02
Dotnetintroduce 100324201546-phpapp02Dotnetintroduce 100324201546-phpapp02
Dotnetintroduce 100324201546-phpapp02
 
Ease of full Stack Development
Ease of full Stack DevelopmentEase of full Stack Development
Ease of full Stack Development
 
(Costless) Software Abstractions for Parallel Architectures
(Costless) Software Abstractions for Parallel Architectures(Costless) Software Abstractions for Parallel Architectures
(Costless) Software Abstractions for Parallel Architectures
 
Introduction To MDD
Introduction To MDDIntroduction To MDD
Introduction To MDD
 
Present and future of unified, portable and efficient data processing with Ap...
Present and future of unified, portable and efficient data processing with Ap...Present and future of unified, portable and efficient data processing with Ap...
Present and future of unified, portable and efficient data processing with Ap...
 
Petapath HP Cast 12 - Programming for High Performance Accelerated Systems
Petapath HP Cast 12 - Programming for High Performance Accelerated SystemsPetapath HP Cast 12 - Programming for High Performance Accelerated Systems
Petapath HP Cast 12 - Programming for High Performance Accelerated Systems
 
Simon Brown: Software Architecture as Code at I T.A.K.E. Unconference 2015
Simon Brown: Software Architecture as Code at I T.A.K.E. Unconference 2015Simon Brown: Software Architecture as Code at I T.A.K.E. Unconference 2015
Simon Brown: Software Architecture as Code at I T.A.K.E. Unconference 2015
 
Perfsystems- Consulting Services
Perfsystems- Consulting ServicesPerfsystems- Consulting Services
Perfsystems- Consulting Services
 
Leveraging Model-Driven Technologies for JSON Artefacts: The Shipyard Case Study
Leveraging Model-Driven Technologies for JSON Artefacts: The Shipyard Case StudyLeveraging Model-Driven Technologies for JSON Artefacts: The Shipyard Case Study
Leveraging Model-Driven Technologies for JSON Artefacts: The Shipyard Case Study
 
LarKC Tutorial at ISWC 2009 - Introduction
LarKC Tutorial at ISWC 2009 - IntroductionLarKC Tutorial at ISWC 2009 - Introduction
LarKC Tutorial at ISWC 2009 - Introduction
 

Recently uploaded

5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 

Recently uploaded (20)

5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 

Source-to-source transformations: Supporting tools and infrastructure

  • 1. Source­to­source transformations Supporting tools and infrastructure Nikolaos Kavvadias nkavv@uop.gr March 31st, 2009 Nikolaos Kavvadias nkavv@uop.gr Source­to­source transformations
  • 2. Source­to­source transformation (1) By the term ‘‘source­to­source transformation’’ we refer to any mechanism that when applied to a SOURCE program, a functionally equivalent TARGET program is produced Basic assumptions SOURCE and TARGET programs submit to the same programming language semantics A ‘‘database’’ of the source program is generated by translating to a form of high­level intermediate representation (HIR) The target program is produced by pretty­printing the HIR view of the source program Secondary assumptions Structural information (e.g. program layout, line numbers) may not be preserved when translating to the HIR form Nikolaos Kavvadias nkavv@uop.gr Source­to­source transformations
  • 3. Source­to­source transformation (2) Potential uses of source­to­source (also termed as ‘‘source­level’’) transformations Algebraic and other simplifications (e.g. matrix flattening) Data access improvements for enhancing data locality Enforcing the use of a data memory hierarchy (data reuse transformations) Conversion to a standard (canonicalized) form Enabling the application of lower level transformations (closer to the underlying machine model) High­level view of the source­to­source translation process Nikolaos Kavvadias nkavv@uop.gr Source­to­source transformations
  • 4. Pragmatics of a source­to­source transformation framework Useful software facilities for implementing a source­to­source transformation framework AST builder and walker AST/HIR query engine Semantics checker and/or HIR validator AST2HIR and HIR2AST modules Z In general, comprehensive frontend facilities would be extremely useful to build upon Nikolaos Kavvadias nkavv@uop.gr Source­to­source transformations
  • 5. An overview of tools and infrastructure Existing software systems The C­to­C source code translator (ftp://theory.lcs.mit.edu/pub/c2c/), now defunct Memphis tree builder and walker tool (http://memphis.compilertools.net/index.html) EDG C/C++ frontend (http://www.edg.com) TXL (http://www.txl.ca) The Cetus project (http://cetus.ecn.purdue.edu/) ROSE compiler infrastructure (http://www.rosecompiler.org) . . . or ‘‘Roll Your Own’’ system/infrastructure Based on extensible text transformation technology: XML + XSLT (http://www.w3.org/2001/XMLSchema) Adapt to exactly fit your needs Nikolaos Kavvadias nkavv@uop.gr Source­to­source transformations
  • 6. The C­to­C MIT source code translation tool Features AST building and type checking from ANSI C Data flow analysis on the AST MIT license Cons Relatively few built­in transformations Further development has ceased Distribution site now defunct (as of late 2005) Suggestions Lack of features and support prevent C2C from being a reliable infrastructure Nikolaos Kavvadias nkavv@uop.gr Source­to­source transformations
  • 7. Memphis Characteristics and features Intended audience are compiler writers Provides basic mechanisms for rule­based tree transformations Works well with Lex and Yacc Memphis personal license + GPL Cons Lack of a ready­to­use C grammar No real world examples Largely unknown to the community Development site ceased (http://www.combo.org) Suggestions Infrastructure is only minimal and not really useful for any practical use Nikolaos Kavvadias nkavv@uop.gr Source­to­source transformations
  • 8. EDG C/C++ frontend Features Mature and complete C/C++ frontend Covers the entire C99 and latest C++ standards AST construction and a rich set of related data structures Extensive documentation ( 600 pages) Actively supported by a company (Edison Design Group) Proprietary open­source license; free for academic research Cons Developing user tools requires a significant time investment No API (which would simplify the development of extensions and plugins) Suggestions Viable choice in case infrastructure development time is more or less irrelevant Nikolaos Kavvadias nkavv@uop.gr Source­to­source transformations
  • 9. TXL Features TXL is a functional programming language mainly used for domain­specific language development Language primitives for specifying tree rewriting rules Comes with many frontends (C, C++, Java, Modula­2/ 3, etc) Has been used in production environments (source code transformations for eliminating patterns of code arising Y2K problems) Cons Development seems to be steered by a single person; no real community being able to contribute TXL is a narrow­scope language No previous experience with TXL Suggestions Viable choice only if the source transformations involved could be easily specified by bare bones term rewriting Nikolaos Kavvadias nkavv@uop.gr Source­to­source transformations
  • 10. Cetus Features Source­to­source C compiler written in Java Extensive set of compiler passes working on a high­level IR Supports parallelization techniques Analyses and transformations Data dependence analysis Loop parallelizer Source program canonicalization Loop outlining (procedural abstraction of loops) Modified Artistic License Cons Depending on external tools (Java libraries, ANTLR) Very small (nonexistent?) community outside Purdue Univ. Suggestions The scope of this infrastructure seems appropriate Focuses on parallelism extraction for OpenMP and not loop restructuring transformations suitable for other purposes Nikolaos Kavvadias nkavv@uop.gr Source­to­source transformations
  • 11. ROSE Features A C++ tool for building source­to­source translators Support for C, C99, UPC, C++, Fortran 77­90/ 95­2003 Builds upon the EDG frontend (included) Under active development Analyses and transformations AST construction, traversal and querying, CFG construction, data flow analyses Predefined loop optimizations: loop interchange, loop fusion, loop fission, loop splitting, loop unrolling Revised BSD license Cons External dependencies (Java, compiled version of Boost) It is unclear whether there is an active community yet Suggestions Scope and purpose of this infrastructure seem appropriate Heavy work for an EDG­based ecosystem already done Nikolaos Kavvadias nkavv@uop.gr Source­to­source transformations
  • 12. Custom text transformation engine based on XML Features XML is a well­established and mature technology Provides the means for specifying your own text manipulation and transformation primitives Vast community of developers and users Cons Development of the infrastructure: constructors, traversals, querying mechanisms, pretty­printers, dumping to debugging formats, fundamental analyses and transformations Development effort cannot be easily estimated Suggestions XML is a tool for serious work given that the development project is closely managed in respect to timeframes and human resources Nikolaos Kavvadias nkavv@uop.gr Source­to­source transformations
  • 13. Conclusion There exist viable solutions for creating a source­to­source translation tool fitting our needs EDG: roll your own analyses and transformations XML: roll your own and customize to your specific needs ROSE: open and extensible infrastructure based on the EDG frontend The choice of one of these solutions requires taking into account subjective factors such as: Communication of ideas, concepts and results to and from other parties involved Extensibility of the infrastructure Preexisting knowledge Personal preference Nikolaos Kavvadias nkavv@uop.gr Source­to­source transformations
  • 14. References I TXL homepage. http://www.txl.ca Memphis tree builder and walker. http://memphis.compilertools.net/index.html The C­to­C source code translator. ftp://theory.lcs.mit.edu/pub/c2c/ The EDG C/C++ frontend. http://www.edg.com The Cetus project. http://cetus.ecn.purdue.edu ROSE: A tool for building source­to­source translators. http://www.rosecompiler.org Nikolaos Kavvadias nkavv@uop.gr Source­to­source transformations
  • 15. Revision history v0.1 (30/03/2009): Initial version Nikolaos Kavvadias nkavv@uop.gr Source­to­source transformations