Meta-circular Dynamic Languages

Meta-circular Dynamic Languages Hernán Wilkinson Octubre 2011 agile software development & services Who am I? •  •  •  •  Hernán Wilkinson 10Pines

13 downloads 220 Views 2MB Size

Recommend Stories


Teaching languages
Asignatura: Enfermería del Anciano Código: 18391 Centro: Facultad de Medicina Titulación: Enfermería Nivel: Grado Tipo: Formación Obligatoria Número d

MAR COLLECTION DYNAMIC
MAR COLLECTION DYNAMIC A highly individual collection conjured up by striking curved lines which invite you to dream about the sea. / Extremadamente

Languages and Literature Division
Languages and Literature Division ASIGNATURA: Written Communication –SPAN 310 M01 SEMESTRE: Spring 2014. HORA DE CLASE: M,T,W,R: 9:00-9:50 CRÉDITOS: 3

WELLEX DYNAMIC TECHNOLOGY COMPETITORS ANALYSIS
WELLEX DYNAMIC TECHNOLOGY COMPETITORS ANALYSIS currently owned by Medtronic Made of Titanium alloy 5 sizes : from 6 to 14mm Works by distracting the

Story Transcript

Meta-circular Dynamic Languages Hernán Wilkinson Octubre 2011

agile software development & services

Who am I? •  •  •  • 

Hernán Wilkinson 10Pines SRL Founder Professor at UBA and UCA (OO, Design, Ing. Soft) FAST Founder (Fundación Argentina de Smalltalk) Software developer lover 

What is a Dynamic Language?

Type checking… what nobody remembers

Advantages

Less Coupling

Advantages – Less Coupling •  Coupled only by the message sent •  FAVORS CHANGE!!! •  Static Typing –  Problem with “to class” a variable and “to type” a variable –  When to create an Interface? –  Changing a variable type problem (No Refactoring!!!)

Disadvantages

Be more careful with “typing” errors

Disadvantages – Typing errors •  Be careful with Refactorings •  Use TDD  Have to do it anyway!!

Disadvantages

Method Lookup Performance

Disadvantages – ML Performance •  Static Typing: –  VTBL •  One indirection on a table •  A change  Index and table regeneration

•  Dynamic Typing: –  GLC: Global Lookup Cache –  PIC: Polymorphic Inline Cache •  The BEST! (David Ungar – Self) •  Used in almost all Smalltalk VMs

Advantages

Favors Iterative/Incremental Development

Advantages – Iterative/Incremental •  Problem: We have to relate Products with Categories. A product like “PC” has to be categorized under “Electronic” –  First in Java  Measure Time and methodology –  Second in Smalltalk  Measure Time and methodology

Advantages – Iterative/Incremental •  Important to have a Meta-Circular language

Let’s get Real!! •  Web App problems –  HTML generation –  Behavior change –  Client and Server synchronization –  State management

Let’s get Real!! •  Web App problems –  HTML generation –  Behavior change –  Client and Server synchronization –  State management

SeaSide! •  Framework to develop app web •  Heavy use of –  Clousure –  Continuations (Meta-programming) –  And many other interesting techniques

•  Open Source, Free, Great! •  www.seaside.st

Metaprogramación y Reflexión  Meta-xxx: Que habla sobre, que define a, xxx  Ejemplo:  Una clase es un Meta-objeto porque define su comportamiento  El español es un “meta-lenguaje” porque puede predicar sobre “si mismo”. Ejemplo: “La palabra casa tiene 4 letras”

Metaprogramación y Reflexión  Sistema Computacional:  Sistema que actúa y razona sobre un dominio

 Casual connection:  Propiedad que asegura que cambios en el dominio se ven reflejados en el modelo y viceversa

 Meta-sistema  Sistema cuyo dominio es otro sistema

 Sistema Reflexivo:  Meta-sistema “casually connected” consigo mismo

Metaprogramación y Reflexión

Metaprogramación y Reflexión  Reflexión:  Habilidad integral de una entidad para representar, operar sobre y tratar consigo mismo en la misma manera que representa, opera sobre y trata con su sujeto primario

 Introspection:  La habilidad de un programa de razonar acerca de si mismo y/o la implementación del lenguaje de programación (read)

 Intercession:  La habilidad de un programa de “actuar” sobre la reificaciones de si mismo y la implementación del lenguaje de programación (write)

Metaprogramación y Reflexión  Reflexión Estructural:  La habilidad de un programa de acceder a su representación estructural y la implementación del lenguaje de programación

 Reflexión de Comportamiento: (Behavioral Reflection)  Habilidad de un programa de acceder a la representación dinámica de si mismo, esto es a la ejecución operacional del programa y de la implementación del lenguaje de programación

Metaprogramación y Reflexión  Lenguajes meta-circulares

Ejemplos Read Structure • All classes • Does implement?

Write • addInstVarNamed: • compile:

• Design rules?

Behavior

• Assertion Name

• Create Method

• Debugger

• Pluggable Proxy • Debugger

Conclusion •  Advantages –  Less Coupling  Favors CHANGE!! –  Favors iterative/incremental development –  Easier to read/Less code to write –  Allows Meta-Circular languages

•  Disadvantages –  More careful with typing errors –  Method Lookup Performance

I Dynamic Languages

We teach this and other important design aspects in our courses Advance Design with OO: Nov 14th •  TDD: Oct 25th, Nov 22nd •  ADVANCE TDD: Dec 12nd Check them out at: http://www.10pines.com/content/cursosdisponibles

•  •  •  • 

Smalltalks 2011!! Next week! It is free! Lot of very knowledgeable people (Ian Piumarta, Kim Rose, Tudor Girba, etc) www.fast.org.ar/smalltalks2011

Questions?

Muchas gracias! [email protected] www.10Pines.com

Argentina

twitter: @10Pines

Tel.: +54 (11) 4780-2460 Paraguay 523, 7N Buenos Aires

agile software development & services

Get in touch

Social

© Copyright 2013 - 2024 MYDOKUMENT.COM - All rights reserved.