SlideShare a Scribd company logo
1 of 30
Download to read offline
1
1
1
Analyzing Dart
Language with Pharo:
Report and early results
Nicolas Hlad, Benoit Verhaeghe, Mustapha
Derras
2
2
2
1. Industrial and Academic contexts
2. What is Dart ?
3. What is our analysis process of Dart ?
4. Conclusion
Presentation Plan
3
3
3
Berger-Levrault
• created 1463 as a printing company
• now an international software editor
• Develop administrative software for cities
administrations, industries, hospitals, etc.
• Since 2022, in collaboration with Evref
• Compagnies with divers technologies :
5
5
5
Flutter and its programming language Dart
since 2014
iOS & Android Web*
since 2011
* On web, the Dart code is compiled to JS Compiler or WebAssembly
Dart code code specific
Virtual Machine
Code specific to the platform : Java, Swift, C#, JS, etc.
PC, MacOS, Linux
8
8
8
Dart Grammar (quick overview)
Parsing Dart
i) Object oriented and function Programming
iii) A “loosely” Typed language
ii) Language features and syntax sugar
9
9
9
Why do we need to analyze Dart ?
With the deprecation of Xamarin, Flutter has
become the main SDK for native multiplatform
development on mobile (and more)
Main language for Flutter
According to spectrum.ieee.org, Dart is the
15th trending language in 2022
Growing popularity
Outside Dart toolkit, we note an absence of
academic or industrial tools to analyze Dart
code. With Platforms like EMF/ECORE focusing on
older language (e.g., Java, C/C++, C#, etc.)
no Software Engineering tool yet
11
11
11
Overview of our analysis of Dart
Figure – Analysis process set up for Dart in Pharo
To exploit and reuse the tools’ suit of Pharo, which has shown to be a reliable static analyzer of
legacy languages like Java, Delphi, and C and which have maturity over industrial use case
Goal
12
12
12
Overview of our analysis of Dart
Parsing Dart
Figure – Analysis process set up for Dart in Pharo
To exploit and reuse the tools’ suit of Pharo, which has shown to be a reliable static analyzer of
legacy languages like Java, Delphi, and C and which have maturity over industrial use case
Goal
13
13
13
Generating a parser with SmaCC
Parsing Dart
EBNF of Dart
for ANTLR
ANTLR
14
14
14
Generating a parser with SmaCC
Parsing Dart
EBNF of Dart
for SmaCC
EBNF of Dart
for ANTLR
'Attribut_of_the_node' {{declared_SmaCC_Node}}
ANTLR
SmaCC
15
15
15
Generating a parser with SmaCC
Parsing Dart
EBNF of Dart
for SmaCC
EBNF of Dart
for ANTLR
SmaCC
16
16
16
Generating a parser with SmaCC
Parsing Dart
EBNF of Dart
for SmaCC
EBNF of Dart
for ANTLR
SmaCC Package Pharo
SmaccDart Parser
AST of Dart
(for a given code)
https://github.com/Evref-BL/SmaccDart
parser + AST visualisation & more…
18
18
18
limitations of SmaCCDart
Parsing Dart
1. Limited to the Dart2 grammar (by ANTLR)
2. No official EBNF grammar by Google a its specification (with ambiguities reported)
3. We use code-refactoring to handle multiline string interpolations and performance issues
19
19
19
limitations of SmaCCDart
Parsing Dart
1. Limited to the Dart2 grammar (by ANTLR)
2. No official EBNF grammar by Google a its specification (with ambiguities reported)
3. We use code-refactoring to handle multiline string interpolations and performance issues
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Addition App’),
),
body: Center(
child:
TextField(labelText: 'Number 1'),
TextField(labelText: 'Number 2’),
),
ElevatedButton(
onPressed: performAddition,
child: Text('Add’),
)
);
}
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text('Addition App’),
),
body: new Center(
child:
new TextField(labelText: 'Number 1'),
new TextField(labelText: 'Number 2’),
),
new ElevatedButton(
onPressed: performAddition,
child: new Text('Add’),
)
);
}
~5 times faster on a class 50 lines
20
20
20
Plan
Visualization tools
21
21
21
Figure – AST visualization made with Roassal3
22
22
22
AnimSearch:
Testing SmaCCDart on a Flutter App
Experimenting visualisations
14 dart files & 2178 LoC
for each file
Extract its corresponding an AST
Using the parser to extract the file dependencies of an opensource flutter app
Use case
23
23
23
Figure – a mermaid visualization of the file dependencies of AnimSearch
24
24
24
Figure – a mermaid visualization of the file dependencies of AnimSearch
With an increasing number of entities to display, visualization becomes hard to understand.
Thus, we rely on model driven engineering to continue the analysis.
limitations
25
25
25
Plan
Model analysis
26
26
26
Defining a Famix Meta Model for Dart
Model Driven Engineering
Package Pharo
SmaccDart Parser
134 SmaCCDart nodes
27
27
27
Defining a Famix Meta Model for Dart
Model Driven Engineering
Package Pharo
SmaccDart Parser
Famix Traits
28
28
28
Defining a Famix Meta Model for Dart
Model Driven Engineering
Package Pharo
SmaccDart Parser
Meta-model Generator
Famix Traits
29
29
29
Defining a Famix Meta Model for Dart
Model Driven Engineering
Package Pharo
SmaccDart Parser
Meta-model Generator FamixDart meta-model
Chartreuse-D
Famix Traits
https://github.com/Evref-BL/Chartreuse-D
Meta-model Generator + model importer
31
31
31
FamixDart Importer in an example
Model Driven Engineering
class
A
class
B
method
mA
method
mB
var
b
class
A
class
B
method
mA
method
mB
var
b
methods ▼
methods ▶
References ▶
Variables ▶
Type ▼
1. Create instances
(from its AST)
2. Symbolic
Resolver from
the AST
FamixDart model’s entities
Entities with associations
32
32
32
Challenge to import FamixDart model
Model Driven Engineering
§ dynamic introduces ambiguity
for symbolic resolution.
§ For A,B two classes, with each a method m()
§ In A, m() as two optional parameters (a,b)
§ In B, m() as one option parameter (a)
At line 17,
how to resolve which method is called between
A::m() and B::m() ?
33
33
33
Conclusion
35
35
35
Take away points
Conclusion
§ We explore how a new language like Dart can be analyzed by existing tools in
Pharo, such as:
1. SmaCC for parser
2. Roassal3 for visualizations
3. And Famix for model driven engineering.
§ We extend those tools to develop :
1. A parser, SmaCCDart
2. And a Famix Meta-model for Dart, FamixDart
3. An famixDart import, Chartreuse-D
§ Our tools are open sources with repository already available.
36
36
36
Future works (late 2023)
Conclusion
§ On SmaCCDart
§ adding no regression tests
§ removing the source code refactoring 🤕
§ On FamixDart
§ continuing the metamodel
§ handling dynamic types when importing associations
§ … and in some years
§ having a Flutter app metamodel (i.e. handling platform specific code in Flutter)
38
38
38
§ Example of AnimeDetailsGenres widget
§ Here we need to capture that :
§ A Container has a Decoration and a child
§ This child is Center widget
§ Center has a Text as child
§ Etc…
§ None of these widgets are attributes of the class
§ Yet, they define how AnimeDetailsGenres is
composed.
§ How to capture this information is our model ?
From dart modeling to Flutter modeling

More Related Content

Similar to Analyzing Dart Language with Pharo: Report and early results

r,rstats,r language,r packages
r,rstats,r language,r packagesr,rstats,r language,r packages
r,rstats,r language,r packagesAjay Ohri
 
Introduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fastIntroduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fastBartosz Kosarzycki
 
330f15_AnsariJonesWilder_Dart.pptx
330f15_AnsariJonesWilder_Dart.pptx330f15_AnsariJonesWilder_Dart.pptx
330f15_AnsariJonesWilder_Dart.pptxpraxyvines
 
Flink Forward Berlin 2017: Aljoscha Krettek - Talk Python to me: Stream Proce...
Flink Forward Berlin 2017: Aljoscha Krettek - Talk Python to me: Stream Proce...Flink Forward Berlin 2017: Aljoscha Krettek - Talk Python to me: Stream Proce...
Flink Forward Berlin 2017: Aljoscha Krettek - Talk Python to me: Stream Proce...Flink Forward
 
Language-agnostic data analysis workflows and reproducible research
Language-agnostic data analysis workflows and reproducible researchLanguage-agnostic data analysis workflows and reproducible research
Language-agnostic data analysis workflows and reproducible researchAndrew Lowe
 
Apache Spark 2.3 boosts advanced analytics and deep learning with Python
Apache Spark 2.3 boosts advanced analytics and deep learning with PythonApache Spark 2.3 boosts advanced analytics and deep learning with Python
Apache Spark 2.3 boosts advanced analytics and deep learning with PythonDataWorks Summit
 
Compiler gate question key
Compiler gate question keyCompiler gate question key
Compiler gate question keyArthyR3
 
Is fortran still relevant comparing fortran with java and c++
Is fortran still relevant comparing fortran with java and c++Is fortran still relevant comparing fortran with java and c++
Is fortran still relevant comparing fortran with java and c++ijseajournal
 
BERT QnA System for Airplane Flight Manual
BERT QnA System for Airplane Flight ManualBERT QnA System for Airplane Flight Manual
BERT QnA System for Airplane Flight ManualArkaGhosh65
 
Introducing Arc: A Common Intermediate Language for Unified Batch and Stream...
Introducing Arc:  A Common Intermediate Language for Unified Batch and Stream...Introducing Arc:  A Common Intermediate Language for Unified Batch and Stream...
Introducing Arc: A Common Intermediate Language for Unified Batch and Stream...Flink Forward
 
Dot Net Fundamentals
Dot Net FundamentalsDot Net Fundamentals
Dot Net FundamentalsLiquidHub
 
Decorating code (Research Paper)
Decorating code (Research Paper)Decorating code (Research Paper)
Decorating code (Research Paper)Jenna Pederson
 
Porting VisualWorks code to Pharo
Porting VisualWorks code to PharoPorting VisualWorks code to Pharo
Porting VisualWorks code to PharoESUG
 
SCALABLE MONITORING USING PROMETHEUS WITH APACHE SPARK
SCALABLE MONITORING USING PROMETHEUS WITH APACHE SPARKSCALABLE MONITORING USING PROMETHEUS WITH APACHE SPARK
SCALABLE MONITORING USING PROMETHEUS WITH APACHE SPARKzmhassan
 

Similar to Analyzing Dart Language with Pharo: Report and early results (20)

r,rstats,r language,r packages
r,rstats,r language,r packagesr,rstats,r language,r packages
r,rstats,r language,r packages
 
Introduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fastIntroduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fast
 
Dart
DartDart
Dart
 
330f15_AnsariJonesWilder_Dart.pptx
330f15_AnsariJonesWilder_Dart.pptx330f15_AnsariJonesWilder_Dart.pptx
330f15_AnsariJonesWilder_Dart.pptx
 
Flink Forward Berlin 2017: Aljoscha Krettek - Talk Python to me: Stream Proce...
Flink Forward Berlin 2017: Aljoscha Krettek - Talk Python to me: Stream Proce...Flink Forward Berlin 2017: Aljoscha Krettek - Talk Python to me: Stream Proce...
Flink Forward Berlin 2017: Aljoscha Krettek - Talk Python to me: Stream Proce...
 
Language-agnostic data analysis workflows and reproducible research
Language-agnostic data analysis workflows and reproducible researchLanguage-agnostic data analysis workflows and reproducible research
Language-agnostic data analysis workflows and reproducible research
 
Apache Spark 2.3 boosts advanced analytics and deep learning with Python
Apache Spark 2.3 boosts advanced analytics and deep learning with PythonApache Spark 2.3 boosts advanced analytics and deep learning with Python
Apache Spark 2.3 boosts advanced analytics and deep learning with Python
 
Compiler gate question key
Compiler gate question keyCompiler gate question key
Compiler gate question key
 
Is fortran still relevant comparing fortran with java and c++
Is fortran still relevant comparing fortran with java and c++Is fortran still relevant comparing fortran with java and c++
Is fortran still relevant comparing fortran with java and c++
 
BERT QnA System for Airplane Flight Manual
BERT QnA System for Airplane Flight ManualBERT QnA System for Airplane Flight Manual
BERT QnA System for Airplane Flight Manual
 
Unit1 cd
Unit1 cdUnit1 cd
Unit1 cd
 
Introducing Arc: A Common Intermediate Language for Unified Batch and Stream...
Introducing Arc:  A Common Intermediate Language for Unified Batch and Stream...Introducing Arc:  A Common Intermediate Language for Unified Batch and Stream...
Introducing Arc: A Common Intermediate Language for Unified Batch and Stream...
 
resumePdf
resumePdfresumePdf
resumePdf
 
Dot Net Fundamentals
Dot Net FundamentalsDot Net Fundamentals
Dot Net Fundamentals
 
Decorating code (Research Paper)
Decorating code (Research Paper)Decorating code (Research Paper)
Decorating code (Research Paper)
 
Porting VisualWorks code to Pharo
Porting VisualWorks code to PharoPorting VisualWorks code to Pharo
Porting VisualWorks code to Pharo
 
Compiler presentaion
Compiler presentaionCompiler presentaion
Compiler presentaion
 
SCALABLE MONITORING USING PROMETHEUS WITH APACHE SPARK
SCALABLE MONITORING USING PROMETHEUS WITH APACHE SPARKSCALABLE MONITORING USING PROMETHEUS WITH APACHE SPARK
SCALABLE MONITORING USING PROMETHEUS WITH APACHE SPARK
 
KIRANKUMAR_MV
KIRANKUMAR_MVKIRANKUMAR_MV
KIRANKUMAR_MV
 
amar_resume
amar_resumeamar_resume
amar_resume
 

More from ESUG

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingESUG
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in PharoESUG
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapESUG
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoESUG
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...ESUG
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6ESUG
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingESUG
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesESUG
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportESUG
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsESUG
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector TuningESUG
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FutureESUG
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the DebuggerESUG
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing ScoreESUG
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptESUG
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocESUG
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsESUG
 
BioSmalltalk
BioSmalltalkBioSmalltalk
BioSmalltalkESUG
 

More from ESUG (20)

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
 
BioSmalltalk
BioSmalltalkBioSmalltalk
BioSmalltalk
 

Recently uploaded

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburgmasabamasaba
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 

Recently uploaded (20)

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - Kanchana
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 

Analyzing Dart Language with Pharo: Report and early results

  • 1. 1 1 1 Analyzing Dart Language with Pharo: Report and early results Nicolas Hlad, Benoit Verhaeghe, Mustapha Derras
  • 2. 2 2 2 1. Industrial and Academic contexts 2. What is Dart ? 3. What is our analysis process of Dart ? 4. Conclusion Presentation Plan
  • 3. 3 3 3 Berger-Levrault • created 1463 as a printing company • now an international software editor • Develop administrative software for cities administrations, industries, hospitals, etc. • Since 2022, in collaboration with Evref • Compagnies with divers technologies :
  • 4. 5 5 5 Flutter and its programming language Dart since 2014 iOS & Android Web* since 2011 * On web, the Dart code is compiled to JS Compiler or WebAssembly Dart code code specific Virtual Machine Code specific to the platform : Java, Swift, C#, JS, etc. PC, MacOS, Linux
  • 5. 8 8 8 Dart Grammar (quick overview) Parsing Dart i) Object oriented and function Programming iii) A “loosely” Typed language ii) Language features and syntax sugar
  • 6. 9 9 9 Why do we need to analyze Dart ? With the deprecation of Xamarin, Flutter has become the main SDK for native multiplatform development on mobile (and more) Main language for Flutter According to spectrum.ieee.org, Dart is the 15th trending language in 2022 Growing popularity Outside Dart toolkit, we note an absence of academic or industrial tools to analyze Dart code. With Platforms like EMF/ECORE focusing on older language (e.g., Java, C/C++, C#, etc.) no Software Engineering tool yet
  • 7. 11 11 11 Overview of our analysis of Dart Figure – Analysis process set up for Dart in Pharo To exploit and reuse the tools’ suit of Pharo, which has shown to be a reliable static analyzer of legacy languages like Java, Delphi, and C and which have maturity over industrial use case Goal
  • 8. 12 12 12 Overview of our analysis of Dart Parsing Dart Figure – Analysis process set up for Dart in Pharo To exploit and reuse the tools’ suit of Pharo, which has shown to be a reliable static analyzer of legacy languages like Java, Delphi, and C and which have maturity over industrial use case Goal
  • 9. 13 13 13 Generating a parser with SmaCC Parsing Dart EBNF of Dart for ANTLR ANTLR
  • 10. 14 14 14 Generating a parser with SmaCC Parsing Dart EBNF of Dart for SmaCC EBNF of Dart for ANTLR 'Attribut_of_the_node' {{declared_SmaCC_Node}} ANTLR SmaCC
  • 11. 15 15 15 Generating a parser with SmaCC Parsing Dart EBNF of Dart for SmaCC EBNF of Dart for ANTLR SmaCC
  • 12. 16 16 16 Generating a parser with SmaCC Parsing Dart EBNF of Dart for SmaCC EBNF of Dart for ANTLR SmaCC Package Pharo SmaccDart Parser AST of Dart (for a given code) https://github.com/Evref-BL/SmaccDart parser + AST visualisation & more…
  • 13. 18 18 18 limitations of SmaCCDart Parsing Dart 1. Limited to the Dart2 grammar (by ANTLR) 2. No official EBNF grammar by Google a its specification (with ambiguities reported) 3. We use code-refactoring to handle multiline string interpolations and performance issues
  • 14. 19 19 19 limitations of SmaCCDart Parsing Dart 1. Limited to the Dart2 grammar (by ANTLR) 2. No official EBNF grammar by Google a its specification (with ambiguities reported) 3. We use code-refactoring to handle multiline string interpolations and performance issues @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Addition App’), ), body: Center( child: TextField(labelText: 'Number 1'), TextField(labelText: 'Number 2’), ), ElevatedButton( onPressed: performAddition, child: Text('Add’), ) ); } @override Widget build(BuildContext context) { return new Scaffold( appBar: new AppBar( title: new Text('Addition App’), ), body: new Center( child: new TextField(labelText: 'Number 1'), new TextField(labelText: 'Number 2’), ), new ElevatedButton( onPressed: performAddition, child: new Text('Add’), ) ); } ~5 times faster on a class 50 lines
  • 16. 21 21 21 Figure – AST visualization made with Roassal3
  • 17. 22 22 22 AnimSearch: Testing SmaCCDart on a Flutter App Experimenting visualisations 14 dart files & 2178 LoC for each file Extract its corresponding an AST Using the parser to extract the file dependencies of an opensource flutter app Use case
  • 18. 23 23 23 Figure – a mermaid visualization of the file dependencies of AnimSearch
  • 19. 24 24 24 Figure – a mermaid visualization of the file dependencies of AnimSearch With an increasing number of entities to display, visualization becomes hard to understand. Thus, we rely on model driven engineering to continue the analysis. limitations
  • 21. 26 26 26 Defining a Famix Meta Model for Dart Model Driven Engineering Package Pharo SmaccDart Parser 134 SmaCCDart nodes
  • 22. 27 27 27 Defining a Famix Meta Model for Dart Model Driven Engineering Package Pharo SmaccDart Parser Famix Traits
  • 23. 28 28 28 Defining a Famix Meta Model for Dart Model Driven Engineering Package Pharo SmaccDart Parser Meta-model Generator Famix Traits
  • 24. 29 29 29 Defining a Famix Meta Model for Dart Model Driven Engineering Package Pharo SmaccDart Parser Meta-model Generator FamixDart meta-model Chartreuse-D Famix Traits https://github.com/Evref-BL/Chartreuse-D Meta-model Generator + model importer
  • 25. 31 31 31 FamixDart Importer in an example Model Driven Engineering class A class B method mA method mB var b class A class B method mA method mB var b methods ▼ methods ▶ References ▶ Variables ▶ Type ▼ 1. Create instances (from its AST) 2. Symbolic Resolver from the AST FamixDart model’s entities Entities with associations
  • 26. 32 32 32 Challenge to import FamixDart model Model Driven Engineering § dynamic introduces ambiguity for symbolic resolution. § For A,B two classes, with each a method m() § In A, m() as two optional parameters (a,b) § In B, m() as one option parameter (a) At line 17, how to resolve which method is called between A::m() and B::m() ?
  • 28. 35 35 35 Take away points Conclusion § We explore how a new language like Dart can be analyzed by existing tools in Pharo, such as: 1. SmaCC for parser 2. Roassal3 for visualizations 3. And Famix for model driven engineering. § We extend those tools to develop : 1. A parser, SmaCCDart 2. And a Famix Meta-model for Dart, FamixDart 3. An famixDart import, Chartreuse-D § Our tools are open sources with repository already available.
  • 29. 36 36 36 Future works (late 2023) Conclusion § On SmaCCDart § adding no regression tests § removing the source code refactoring 🤕 § On FamixDart § continuing the metamodel § handling dynamic types when importing associations § … and in some years § having a Flutter app metamodel (i.e. handling platform specific code in Flutter)
  • 30. 38 38 38 § Example of AnimeDetailsGenres widget § Here we need to capture that : § A Container has a Decoration and a child § This child is Center widget § Center has a Text as child § Etc… § None of these widgets are attributes of the class § Yet, they define how AnimeDetailsGenres is composed. § How to capture this information is our model ? From dart modeling to Flutter modeling