Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Modeling ASTs with FAST (mooseday13)
Search
Yuriy Tymchuk
April 04, 2013
Science
270
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Modeling ASTs with FAST (mooseday13)
Yuriy Tymchuk
April 04, 2013
More Decks by Yuriy Tymchuk
See All by Yuriy Tymchuk
JIT Feedback — what Experienced Developers like about Static Analysis (icpc2018)
uko
0
370
Renraku — the One Static Analysis Model to Rule Them All (iwst2017)
uko
0
240
Pharo Quality Engine: The Last Strokes (esug2017)
uko
0
170
The False False Positives of Static Analysis (sattose2017)
uko
0
140
Про що не говорять програмісти, про що мовчать науковці MK2 (ucu2016)
uko
1
200
Walls, Pillars and Beams: A 3D Decomposition of Quality Anomalies (vissoft2016)
uko
0
280
Stories About Renraku — the new Quality Model of Pharo (esug2016)
uko
0
400
When QualityAssistant Meets Pharo [Enforced Code Critiques Motivate More Valuable Rules] (iwst2016)
uko
0
350
Про що не говорять програмісти, про що мовчать науковці (ucu2015)
uko
1
160
Other Decks in Science
See All in Science
勾配流から乖離した学習ダイナミクス
hanbao
1
1k
生成AIが科学とRAにもたらしていること:メタサイエンスの視点から
rmaruy
0
140
Testing the Longevity Bottleneck Hypothesis
chinson03
0
470
機械学習 - K近傍法 & 機械学習のお作法
trycycle
PRO
1
1.6k
生成AI・プレプリント時代における 研究成果公開の再設計 ― トップカンファレンス文化はどこへ向かうのか / Redesigning the Dissemination of Research Outputs in the Age of Generative AI and Preprints — Where Is the Top-Conference Culture Heading?
ykiyota
0
30k
摂理と合理の肉体改造 — AI時代の減量を支える観測・制御・継続
kiyoshi
0
3.5k
機械学習 - SVM
trycycle
PRO
2
1.2k
O(log n)-Approximation Algorithms for Bipartiteness Ratio
tasusu
0
190
Kritische evaluatie van GenAI-output voor literatuuronderzoek
voginip
0
240
Does the Efficient Compute Frontier Represent New Physics?
drqz
0
120
[TMLR 2026, Featured Certification] Double Bounded α-Divergence Optimization for Density Estimation
gkazunii
1
120
J-STAGE全文XML登載必須化について
xspa2012
0
1.5k
Featured
See All Featured
Product Roadmaps are Hard
iamctodd
55
13k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
450
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
230
The untapped power of vector embeddings
frankvandijk
2
1.9k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
320
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
GraphQLとの向き合い方2022年版
quramy
50
15k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
850
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.5k
Transcript
MODELING ASTS WITH FAST Yuriy “Uko” Tymchuk
MOOSE
FAMIX
FAMIX
FAMIX Access Invocation
PROBLEM? • Calculating metrics • Rule checking • Detecting duplication
• Representing (eg. visualizing) • Language conversions • And more…
can’t handle that! AST FAMIX we need
FAST
FAST 0% 25% 50% 75% 100% Smalltalk Java
FAST
FAST IMPORTERS PetitParser
MODEL
GENERAL FAST DIAGRAM FASTBehaviouralEntity 0..* statements 0..1 parentStatementBlock FASTStatement FASTNamedEntity
name : String 0..* parameters 0..* localVariables FAMIXBehaviouralEntity 0..1 fastNamedBehaviouralEntity 0..1 famixBehaviouralEntity FAMIXNamedEntity 0..* fastNamedEntities 0..1 famixNamedEntity FASTNamedBehaviouralEntity name : String FASTExpression 0..1 parentBehaviouralEntity 0..1 parentExpression** 0..1 parentStatement** FASTStatementBlock 0..1 parentBehaviouralEntity 0..1 statementBlock FASTVariableExpression 0..1 parentVariableExpression 0..1 variable FASTLiteral signature : string
SMALLTALK FAST DIAGRAM FASTBehaviouralEntity 0..* statements 0..1 parentStatementBlock FASTVariableExpression FASTLiteral
signature : String FASTMessageSend kind selector isUnary() isBinary() isKey() cascaded() receiver() FASTStatement 0..1 parentExpression 0..* arguments FASTAssignmentExpression 0..1 parentAssignmentExpression 0..1 variable FASTExpression 0..1 parentStatement 0..1 expression FASTArrayExpression FASTCascade 0..1 parentCascade 0..* messages 0..1 parentExpression 0..1 concreteReceiver 0..1 parentExpression 0..1 block FASTSmalltalkReturnStatement FASTSmalltalkExpressionStatement 0..1 parentStatement 0..1 expression 0..1 parentExpression 0..1 expression FASTNamedEntity name : String 0..* parameters 0..* localVariables 0..1 parentVariableExpression 0..1 variable FASTBlockDefinition FAMIXBehaviouralEntity 0..1 fastNamedBehaviouralEntity 0..1 famixBehaviouralEntity FAMIXNamedEntity 0..* fastNamedEntities 0..1 famixNamedEntity FASTNamedBehaviouralEntity name : String FASTNumberLiteral value : Number FASTCharacterLiteral value : Object FASTStringLiteral value : String FASTSymbolLiteral value : Object FASTArrayLiteral FASTByteArrayLiteral 0..* contents 0..* contents FASTBlockExpression 0..1 parentExpression 0..* contents FASTBooleanLiteral value : Boolean FASTUndefinedLiteral 0..1 parentExpression 0..1 receiver 0..1 parentBehaviouralEntity FAMIXInvocation 0..1 messageSend 0..1 invocation FASTStatementBlock 0..1 parentBehaviouralEntity 0..1 statementBlock
RB CASCADE DESIGN Cascade Message1 arguments… Message2 arguments… Message3 arguments…
RECEIVER
FAST CASCADE DESIGN Cascade RECEIVER Message1 arguments… Message2 arguments… Message3
arguments…
SMALLTALK / JAVA COMPARISON 0 8 15 23 30 Statements
Expression Smalltalk Java
http://uko-on-code.blogspot.com
JAVA FAST DIAGRAM FASTBehaviouralEntity 0..* statements 0..1 parentStatementBlock FASTStatement FASTNamedEntity
name : String 0..* parameters 0..* localVariables FAMIXBehaviouralEntity 0..1 fastNamedBehaviouralEntity 0..1 famixBehaviouralEntity FAMIXNamedEntity 0..* fastNamedEntities 0..1 famixNamedEntity FASTNamedBehaviouralEntity name : String FASTExpression 0..1 parentBehaviouralEntity StatementBlock 0..1 parentBehaviouralEntity 0..1 statementBlock FASTVariableExpression 0..1 parentVariableExpression 0..1 variable FASTLiteral signature : string FASTJavaExpressionStatement FASTJavaReturnStatement 0..1 parentStatement 0..1 expression 0..1 parentStatement 0..1 expression FASTWhileStatement 0..1 parentStatement 0..1 condition 0..1 parentStatement 0..1 body FASTVariableDeclarationStatement FASTVariableDeclarator 0..1 parentStatement 0..* declarators 0..1 variable 0..1 initializer FASTJavaIntegerLiteral FASTJavaBooleanLiteral FASTJavaStringLiteral FASTInfixOperation 0..1 parentExpression 0..1 leftOperand 0..1 parentExpression 0..1 rightOperand
FAST ANALYSES
SYMBOL RESOLUTION #middleOf:and: b a sum ^st st := sum
+ a b / sum 2 middleOf: a and: b | sum | sum := a + b. ^ sum / 2
SYMBOL RESOLUTION b a sum #middleOf:and: b a sum ^st
st := sum + a b / sum 2
SYMBOL RESOLUTION b a sum #middleOf:and: b a sum ^st
st := sum + a b / sum 2
RESOLVING SYMBOLS Scope • name-variable dictionary • parent scope •
owner entity Scope • name-variable dictionary • parent scope • owner entity
CALCULATING METRICS • nodes of a Kind • cyclomatic complexity
Amount of something in code
CALCULATING METRICS collection inject: initial into: [block] CollectorVisitor newWithSeed: initial
andBlock: [block]
CYCLOMATIC COMPLEXITY Each node knows it’s complexity contribution • Class
= 0 • ReturnStatement = 0 • IfStatement = 1 • WhileStatement = 1 • MessageSend (#ifTrue:) = 1! ! ! ! calculated at runtime • MessageSend (#detect:ifNone:) = 2 • “for ... else” statement = 2!! ! ! ! python
FAST CONTRIBUTION http://smalltalkhub.com/#!/~YuriyTymchuk/FAST https://github.com/Uko/FAST https://ci.inria.fr/moose/job/FAST-On-Moose
FAST GSOC FAST Java Model Tree models visualization The idea
behind this project is to develop an inter active tree visualization that will gradually improve analysis of the underlying model. The goal of this project is to create a Java version of FAST.
THANKS Stéphane Ducasse Nicolas Anquetil RMoD team
FAST