Pegon: an optional type system for Smalltalk-80

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Pegon: an optional type system for Smalltalk-80

Rob Smit
At AG5 we developed an extension to the Cincom Smalltalk language to enable type annotations. This project is called `Pegon', an optional type system.
Pegon enables type inference and type checking by making a compile-time abstraction of the runtime behavior.
It does not mandate type annotations and has no effect on the runtime semantics. The project is highly influenced by Strongtalk(http://www.strongtalk.org/) but integrates with Cincom Smalltalk.

AG5 has a large code base to maintain and evolve with a growing team
of developers and locations. Pegon is introduced to enable:
- Early feedback
- Reliability and readability of programs during development and maintenance
- Describe the interface(s) between modules
- Translating Smalltalk code to static-typed languages
- Improve program analysis possibilities

Pegon currently includes constructs like(influenced by Strongtalk):
- Type Generics
- Parametric Polymorphism
- Protocol specifications (like Java interfaces)
- Union types (e.g. String or Nil)
- Subtraction types (e.g. Any but Nil)
- Type Casts

An example of a type annotated method is:
Party>>isSponsor: possibleSponsor {Person} {^Bool}
    ˆself sponsors anySatisfy: [:each | each = possibleSponsor]

These methods can be type inferred or type checked using the added 'pegon' operate menus in the code tool and navigator.

Pegon is much of a work in progress. To increase the development, feedback and discussion we made the project open source under a BSD license since April.
The project webpage is hosted at http://sourceforge.net/projects/pegon. At the files section at http://sourceforge.net/projects/pegon you get a more detailed description of the project.
The project is published in the Cincom Public Respository(load the bundle named 'Pegon' or package 'Pegon Config' to get all the prerequisites).
Currently we use and develop the project in VW 7.6.
We also tested the code in VW 7.8 but the highlighting of the type annotations is not yet enabled in this version(the VW highlighting model is changed in vw 7.8).
Please feel free to participate in the project or send feedback.
You could use the project website to start discussions.
In the time coming I will use the project website to distribute tutorials and progressions.
To contact me directly, please send me an email([hidden email]).

Hope you like it!

Rob Smit

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc