Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
research:software:gradualtalk [2013/05/09 12:06]
etanter
research:software:gradualtalk [2014/06/11 12:21]
oalvarez [Download]
Line 1: Line 1:
 ====== A Practical Gradual Type System For Smalltalk ====== ====== A Practical Gradual Type System For Smalltalk ======
  
-Gradualtalk is a gradually-typed Smalltalk, which is fully compatible with existing Smalltalk code. Following the philosophy of Typed Racket, a major design goal of Gradualtalk is that the type system should accomodate existing programming idioms in order to allow for an easy, incremental path from untyped to typed code. The design of Gradualtalk was guided by a study of existing Smalltalk projects, and incrementally typing them in Gradualtalk.+Gradualtalk is a gradually-typed Smalltalk, which is fully compatible with existing Smalltalk code. Following the philosophy of Typed Racket, a major design goal of Gradualtalk is for the type system to accomodate existing programming idioms in order to allow for an easy, incremental path from untyped to typed code. The design of Gradualtalk was guided by a study of existing Smalltalk projects, and incrementally typing them in Gradualtalk.
  
-The type system of Gradualtalk supports as much Smalltalk idioms as possible through a number of features: a combination of nominal and structural types, union types, self types, parametric polymorphism, and blame tracking, amongst others. +The type system of Gradualtalk supports as many Smalltalk idioms as possible through a number of features: a combination of nominal and structural types, union types, self types, parametric polymorphism, and blame tracking, amongst others. 
  
 **Gradualtalk team:** Esteban Allende, Oscar Callaú, Johan Fabry, Éric Tanter **Gradualtalk team:** Esteban Allende, Oscar Callaú, Johan Fabry, Éric Tanter
Line 25: Line 25:
   * **Union type**: String | Integer   * **Union type**: String | Integer
  
-However the types are only a half of the story, using them is the another half. Gradualtalk allows programmers to use this types in any place where declaring a variable or typing an expression is need. [[gradualtalk#Quick Reference|Quick Reference]] refers to these with several examples.+However the types are only a half of the story, using them is the another half. Gradualtalk allows programmers to use these types in any place where declaring a variable or typing an expression is need. [[gradualtalk#Quick Reference|Quick Reference]] refers to these with several examples.
  
 ===== Download ===== ===== Download =====
  
-The latest version of Gradualtalk can be found here [[https://ci.inria.fr/rmod/job/Gradualtalk/|Gradualtalk (Jenkins)]]+There are two images to download:
  
-There are two images:+  * **{{research:software:gradualtalk:gradualtalk.zip|gradualtalk.zip}}**: The basic image of the Gradual Type System 
 +  * **{{research:software:gradualtalk:gradualtalk-typedkernel.zip|gradualtalk-typedkernel.zip}}**: Has the same functionalities that the basic image, but additionally some kernel classes and the type system has been typed.
  
-  * **Gradualtalk.zip**: The basic image of the Gradual Type System +We recommend using the latest [[http://pharo.org/downloadPharoVM]].
-  * **Gradualtalk-TypedKernel.zip**: Has the same functionalities that the basic image, but additionally some kernel classes and the type system has been typed. +
- +
-We recommend to use the [[http://www.mirandabanda.org/files/Cog/VM/|Cog VM]].+
  
 As examples, we include some typed projects, available for download: As examples, we include some typed projects, available for download:
Line 43: Line 41:
   * [[ http://www.pleiad.cl/gradualtalk/typed-projects/Zinc-Typed.zip |Zinc]]   * [[ http://www.pleiad.cl/gradualtalk/typed-projects/Zinc-Typed.zip |Zinc]]
   * [[ http://www.pleiad.cl/gradualtalk/typed-projects/Spec.zip |Spec]]   * [[ http://www.pleiad.cl/gradualtalk/typed-projects/Spec.zip |Spec]]
 +====== Publications ======
 +
 +These are the research publications related with Gradualtalk:
 +  * {{bib>allendeAl-scp2013|Gradual Typing for Smalltalk}}: Accepted for publication in Science of Computer Programming, 2013 (PDF available)
 +  * {{bib>allendeAl-dls2013|Cast Insertion Strategies for Gradually-Typed Objects}}: Published in Proceedings of the 9th ACM Dynamic Languages Symposium (DLS 2013)
 ====== Quick Reference ====== ====== Quick Reference ======
  
 ===== Activating the Type System ===== ===== Activating the Type System =====
  
-The type system is optional and by default it is deactivated. The reason for this is that the most packages in the Pharo VM are untyped. Activating Gradualtalk by default will leave to an unnecessary agglomeration of implicit casts.+The type system is optional and by default it is deactivated. The reason for this is that most packages in the Pharo VM are untyped. Activating Gradualtalk by default will lead to an unnecessary agglomeration of implicit casts.
  
-To active the type system in a given class (and all its subclasses), it is needed  to add the TTyped trait to the class like this:+To activate the type system in a given class (and all its subclasses), the TTyped trait needs to be added to the class like this:
  
 <code smalltalk> <code smalltalk>
Line 63: Line 66:
 ===== Typing Language Entities ===== ===== Typing Language Entities =====
  
-The following are a series of example to type language entities, such as methods, variables, blocks, etc.+The following are a series of example to typing language entities, such as methods, variables, blocks, etc.
 ==== Typing a method declaration ==== ==== Typing a method declaration ====
  
Line 127: Line 130:
 With this definition, Dictionary<String, Integer> would define that K=String and V=Integer. Type variables for ancestor classes are superseeded by default when declaring new parametric variables. With this definition, Dictionary<String, Integer> would define that K=String and V=Integer. Type variables for ancestor classes are superseeded by default when declaring new parametric variables.
 ==== Redefining old class parametric types ==== ==== Redefining old class parametric types ====
-When declaring new type variables in a class where its ancestor has type variables, the old type variables maintain its old significance. However, this maybe is not the desired effect. Using 'oldParametricVariablesAs' allows to redefine them as necessary.+When declaring new type variables in a class where its ancestor has type variables, the old type variables maintain their old significance. However, this may not be the desired effect. Using 'oldParametricVariablesAs' allows to redefine them as necessary.
  
 <code smalltalk> <code smalltalk>
Line 174: Line 177:
 </code> </code>
  
-addAlias: is a common method between Type objectsthat its supported by all types except Self, Dyn and Parametric types. For the moment, Type objects must be generated manually.+addAlias: is a common method between Type objects that its supported by all types except Self, Dyn and Parametric types. For the moment, Type objects must be generated manually.
  
 ===== Runtime casts ===== ===== Runtime casts =====
  
-By default, method instrumentation and runtime casts are enable. However in some cases, programmers do not want to worry about method instrumentation and runtime casts, eg. type annotations are only a checked documentation of the project. Because of this, we include the ability to disable runtime casts:+By default, method instrumentation and runtime casts are enabled. However in some cases, programmers do not want to worry about method instrumentation and runtime casts, eg. type annotations are only a checked documentation of the project. Because of this, we include the ability to disable runtime casts:
 <code smalltalk> <code smalltalk>
 Gradualtalk configuration enableInstrumentation: false. Gradualtalk configuration enableInstrumentation: false.
Line 186: Line 189:
 Then, recompile the code that you want to be free of method instrumentation and runtime casts. Then, recompile the code that you want to be free of method instrumentation and runtime casts.
  
-The type system performs blame tracking to appropriately blame the wrong expressions. For higher-order casts, the blame tracking strategy is lazy and only blames downcasts (casts from dyn to concrete types). This means that cast errors are detected only when the block is invoked and downcasts have all responsibility for potential errors.+The type system performs blame tracking to appropriately blame the wrong expressions. For higher-order casts, the blame tracking is lazy and only blames downcasts (casts from dyn to concrete types). This means that cast errors are detected only when the block is invoked and downcasts are wholly responsible for potential errors.
  
 ===== Tool Support ===== ===== Tool Support =====
Line 213: Line 216:
  
 We are working into provide support to Monticello in order to easily upload/download typed code. We are working into provide support to Monticello in order to easily upload/download typed code.
-