SlideShare una empresa de Scribd logo
1 de 29
Descargar para leer sin conexión
Desmitificando la creación de herramientas
que interactúan con código
Demystifying the creation of coding tools
Facundo Javier Gelatti
¿Cuál es el objetivo de la charla?
The Goal
Conceptos previos
Preliminary concepts
Creando una herramienta en vivo
Creating a tool, live
¿Cuál es el objetivo de la
charla?
The Goal
Herramientas que interactúan con el código
Tools that interact with code
¿Cómo hacemos para
crear algo así?
How can we create
something like this?
¡Aprendemos con ejemplos!
We learn by example!
Resaltar ifs (envíos del mensaje ifTrue:)
Highlight ifTrue: message sends
Resaltar ifs (envíos del mensaje ifTrue:)
Highlight ifTrue: message sends
Pff, eso es fácil! Si el código es texto, buscá
las ocurrencias de “ifTrue:” y listo
Easy! The code is text, so you can just search for “ifTrue:”
and that’s it!
Veamos si era tan fácil...
Let’s see if it was that easy...
Veamos si era tan fácil...
Let’s see if it was that easy...
Conceptos previos
Preliminary concepts
¿Puede ser el código otra
cosa, si no texto?
Can code be anything other than text?
Cuando pensamos en
código, no pensamos en
las letras
When we think about code, we don’t think
in terms of characters
Árbol de sintaxis abstracta
(AST)
Abstract Syntax Tree
Method
Message
#ifTrue:ifFalse: Block Block
Return
self
Message
Return
self #negated
selectorreceptor
argumentos
receptor selector
Message
#<self 0
receptor selector argumento
Message
#ifTrue:ifFalse: Block Block
Return
self
Message
Return
self #negated
selectorreceptor
argumentos
receptor selector
Message
#<self 0
receptor selector argumento
Method
Block
Parser
Nota de color: ¿Cómo se genera el AST?
Sidenote: How is the AST generated?
....
¿Cómo usamos el AST?
How do we use the AST?
Resaltar ifs (envíos del mensaje ifTrue:)
Highlight ifTrue: message sends
¿Cómo recorremos el AST
de un método, para buscar
los envíos de mensajes
ifTrue:?
How do we traverse a method’s AST looking
for ifTrue: message sends?
Visitor
La estructura del Visitor
The structure of the Visitor
¡Veamos cómo funciona!
Let’s see how it works!
Ya sabemos lo que es un AST, y cómo
recorrerlo para hacer cosas...
Now we know what an AST is, and how to
traverse it to do things
¡Construyamos la
herramienta!
Let’s build the tool!
Conclusión
Conclusion
● Se puede pensar en el código más allá de un simple
conjunto de caracteres.
● Podemos entender cómo funcionan las
herramientas que usamos, y ver que no hay magia.
● Somos capaces de desarrollar nuestras propias
herramientas (¡hay que animarnos a hacerlo!).
CONTACT
Facundo Javier Gelatti
javiergelatti@gmail.com
¡Gracias!
Thank you!

Más contenido relacionado

Más de FAST

Using 128 GPU cores, Tensorflow and VASmalltalk to detect Kolsh beers with ES...
Using 128 GPU cores, Tensorflow and VASmalltalk to detect Kolsh beers with ES...Using 128 GPU cores, Tensorflow and VASmalltalk to detect Kolsh beers with ES...
Using 128 GPU cores, Tensorflow and VASmalltalk to detect Kolsh beers with ES...
FAST
 
VASmalltalk and Raspberry Pi powering the largest MIDI instrument of the world
VASmalltalk and Raspberry Pi powering the largest MIDI instrument of the worldVASmalltalk and Raspberry Pi powering the largest MIDI instrument of the world
VASmalltalk and Raspberry Pi powering the largest MIDI instrument of the world
FAST
 
Hands-on Raspberry Pi and VA Smalltalk - Starting Workshop
Hands-on Raspberry Pi and VA Smalltalk - Starting WorkshopHands-on Raspberry Pi and VA Smalltalk - Starting Workshop
Hands-on Raspberry Pi and VA Smalltalk - Starting Workshop
FAST
 

Más de FAST (20)

Improving the Pharo VM
Improving the Pharo VMImproving the Pharo VM
Improving the Pharo VM
 
What is (not) Pharo 8?
What is (not) Pharo 8?What is (not) Pharo 8?
What is (not) Pharo 8?
 
Stargate: an interstellar journey to RESTful APIs
Stargate: an interstellar journey to RESTful APIsStargate: an interstellar journey to RESTful APIs
Stargate: an interstellar journey to RESTful APIs
 
Opening Smalltalks 2019
Opening Smalltalks 2019Opening Smalltalks 2019
Opening Smalltalks 2019
 
Smalltalk Computers, Past and Future by Jecel Mattos de Assumpção Jr
Smalltalk Computers, Past and Future by Jecel Mattos de Assumpção JrSmalltalk Computers, Past and Future by Jecel Mattos de Assumpção Jr
Smalltalk Computers, Past and Future by Jecel Mattos de Assumpção Jr
 
Adaptive Compilation by Jecel Mattos de Assumpção Jr
Adaptive Compilation by Jecel Mattos de Assumpção JrAdaptive Compilation by Jecel Mattos de Assumpção Jr
Adaptive Compilation by Jecel Mattos de Assumpção Jr
 
Choosing where to run our objects: the S8 Smalltalk approach by Description:F...
Choosing where to run our objects: the S8 Smalltalk approach by Description:F...Choosing where to run our objects: the S8 Smalltalk approach by Description:F...
Choosing where to run our objects: the S8 Smalltalk approach by Description:F...
 
Using 128 GPU cores, Tensorflow and VASmalltalk to detect Kolsh beers with ES...
Using 128 GPU cores, Tensorflow and VASmalltalk to detect Kolsh beers with ES...Using 128 GPU cores, Tensorflow and VASmalltalk to detect Kolsh beers with ES...
Using 128 GPU cores, Tensorflow and VASmalltalk to detect Kolsh beers with ES...
 
Improving VASmalltalk deployment, availability and scalability with Docker by...
Improving VASmalltalk deployment, availability and scalability with Docker by...Improving VASmalltalk deployment, availability and scalability with Docker by...
Improving VASmalltalk deployment, availability and scalability with Docker by...
 
VASmalltalk and Raspberry Pi powering the largest MIDI instrument of the world
VASmalltalk and Raspberry Pi powering the largest MIDI instrument of the worldVASmalltalk and Raspberry Pi powering the largest MIDI instrument of the world
VASmalltalk and Raspberry Pi powering the largest MIDI instrument of the world
 
Hands-on Raspberry Pi and VA Smalltalk - Starting Workshop
Hands-on Raspberry Pi and VA Smalltalk - Starting WorkshopHands-on Raspberry Pi and VA Smalltalk - Starting Workshop
Hands-on Raspberry Pi and VA Smalltalk - Starting Workshop
 
Live typing: Update and what's next by Hernan Wilkinson
Live typing: Update and what's next by Hernan WilkinsonLive typing: Update and what's next by Hernan Wilkinson
Live typing: Update and what's next by Hernan Wilkinson
 
Enhanced Email Protocol Framework for VAST by Seth Berman
Enhanced Email Protocol Framework for VAST by Seth BermanEnhanced Email Protocol Framework for VAST by Seth Berman
Enhanced Email Protocol Framework for VAST by Seth Berman
 
VA Smalltalk Product Update by Seth Berman
VA Smalltalk Product Update by Seth BermanVA Smalltalk Product Update by Seth Berman
VA Smalltalk Product Update by Seth Berman
 
Cuis Smalltalk: Past, present and future by By Hernán Wilkinson & Juan Vuletich
Cuis Smalltalk: Past, present and future by By Hernán Wilkinson & Juan VuletichCuis Smalltalk: Past, present and future by By Hernán Wilkinson & Juan Vuletich
Cuis Smalltalk: Past, present and future by By Hernán Wilkinson & Juan Vuletich
 
Tonel repositories in VA Smalltalk by Esteban Maringolo
Tonel repositories in VA Smalltalk by Esteban MaringoloTonel repositories in VA Smalltalk by Esteban Maringolo
Tonel repositories in VA Smalltalk by Esteban Maringolo
 
Deviation Testing: A Test Case Generation Technique for GraphQL APIs by Danie...
Deviation Testing: A Test Case Generation Technique for GraphQL APIs by Danie...Deviation Testing: A Test Case Generation Technique for GraphQL APIs by Danie...
Deviation Testing: A Test Case Generation Technique for GraphQL APIs by Danie...
 
Animations and Native Deployment for games in Winter by Alvaro Piorno
Animations and Native Deployment for games in Winter by Alvaro PiornoAnimations and Native Deployment for games in Winter by Alvaro Piorno
Animations and Native Deployment for games in Winter by Alvaro Piorno
 
Opening Smalltalks 2018
Opening Smalltalks 2018Opening Smalltalks 2018
Opening Smalltalks 2018
 
Lazaro for Cuis by Gastón Caruso
Lazaro for Cuis by Gastón CarusoLazaro for Cuis by Gastón Caruso
Lazaro for Cuis by Gastón Caruso
 

Demystifying the creation of coding tools