lundi 6 avril 2009

The SICS Java Port Project







This book relates the migration of a large Smalltalk system to Java. This migration was essentially based on a semi-automated source code translation: each Smalltalk class, method and instruction is translated into Java. This experience report presents challenges of this rewriting from a technical point of view. It basically compares the paradigm of Smalltalk and Java and presents translating rules and patterns.

After a brief introduction to Smalltalk, Chapter 3 provides the vocabulary to describes the types used by the type inferencer. Chapter 4 provides an extended description of typing issues that may occur when migrating (including generating casts and translating to generics). Mapping Smalltalk control flow construction into Java are covered in Chapter 5 until Chapter 9. The mapping is rather unsurprising. Mapping singular Smalltalk points (blocks in Chapter 8 and the numerical computational model in Chapter 9) are probably the most exiting chapters. Limitation of Java are clearly apparent. Remaining chapters (10 - 15) are about the Smalltalk features that are missing in Java (e.g., class extensions, intersession, advanced error handling mechanism). The mapping is essentially ad hoc in that case. Chapters 16 and 17 conclude.

Although it clearly emerges that a special care is given to be accurate, some points are left unclear. For example, a deeper analysis on the use of meta-classes in Smalltalk would be welcome. Smalltalk supports meta-classes and Java does not. As rightfully pointed out by the author, migrating a hierarchy of meta-classes to Java is not trivial. But it is left unclear why meta-classes in Smalltalk are essentially used to define constructor. Polymorphism involving meta-classes is rarely employed. Another point: Page 39 says “As Smalltalk is a dynamically typed language, there is not really any concept of types”. This is incorrect. In Smalltalk, type enforcement happens at runtime, instead of at compile-time. The whole discussion about types is done in a very informal way, which misses accuracy.

The translation strategies remains very technical without giving any high-level perspective. In particular, a software engineering perspective is missing. The book is about how the migration was conducted, and no indication is provided about why the migration was necessary. It seems to be taken for granted that adopting the Java platform is a step forward, but no discussion about long-term company strategy is provided. A discussion about the rational of such major decisions would have been of a great value, since chapters 10 until 15 are about Java limitations and weaknesses and Section 15.4 says the translated version is four time larger than the original Smalltalk application.

These criticisms aside, the book presents a well-thought semi-automated solution on how to translate a dynamically typed language into a statically typed one taking meta-classes and reflection into account.

Aucun commentaire:

Enregistrer un commentaire