LSWVST .NET Integration

When Microsoft  launched the development of .NET a few years back - we have regarded this a second chance for Smalltalk and were fascinated by the possibility  to use our Smalltalk for development of .NET programs.

A deep integration of Smalltalk into .NET so that according to Microsofts .NET language philosophy Smalltalk can implement arbitrary  .NET classes is not possible . Important qualities of Smalltalk as an "everything is an Object" system would be lost   - In Smalltalk if a class shape is changed, objects of this class mutate.

While one doesn't have to make any difference between design-time and run-time in Smalltalk - in Microsoft's C# which is derived from in traditional languages there is a clear border between the description of an Object at design-time and its existence at run-time. This is an efficiency advantage of traditional languages but also a considerable reduction in the Power of a language. While in Smalltalk blocks - anonymous code can be used in form of objects, e.g. passed as arguments this is impossible in traditional languages because of the separation between "description" and "instance".

Just exactly these powerful constructs are superior for Smalltalk programming and they should not get lost -  otherwise only a empty wrapping would be left.

We have decided create two integrations - a design-time and a run-time integration. We only regard .NET as a function library at design-time. Already here we have gained much -  the traditional bindings of external functionality to Smalltalk has already often been a large obstacle, with .NET now for the first time it is an object-oriented one.

Here we have the "disadvantage" that we cannot refine an arbitrary class in the .NET framework by "Subclassing" as provided by Microsoft directly, this would correspond to the dynamic extension of a system library. If we want to do this, we must translate Smalltalk into MSIL and generate a .NET Assembly, then be able to load it again.

And we come to the second part of our .NET bindings - the translation from Smalltalk into MSIL. Smalltalk has an "unusual feature" which makes it difficult to translate. While in traditional languages methods (the functions in object-oriented languages) have defined object types in Smalltalk both the description of a class and those of a method is free of type definitions. A translation from Smalltalk into a language in which  functionality must be defined on well defined object data types is not possible. In Smalltalk the class library must be considered as much more general  and for a transation a set of typed definitons must be generated. We support this process by type inference. The "substrate" is supplied to a traditional compiler with a MSIL Backend.

The strategy chosen by us make it possible for us to keep the advantages of the Smalltalk during the development time and to achieve optimal results at runtime. The strategy is contrary to the deep integration approach of Smallscript which extends .NET with an AOS-language enabler to be able to preserve Smalltalk features nuder .NET.

The LSWVST .NET Integration is used to create the LSW DotNet-Tools.

The LSWVST .NET Integration consist of 2 parts:

.NET Development integration

Bindings to .NET to allow easy Development for .NET from LSW-Vision-Smalltalk. .NET Framework is just a regarded as a huge Library to which we bind using special primitives. We don't change Smalltalk to be able to bind to .NET. 

.NET is just a COM-Library.

.NET Assembly Graph

This Assembly-Graph allows you to explore a .NET Assembly in a graphical way

.NET Reflection Browser

The .NET Reflection-Browser allows you to explore a .NET Assembly in the standard explorer way

.NET Reflection Browser

The .NET Reflection-Browser enables you to browse the .NET framework in the Smalltalk way.

.NET Inspector 

The .NET Inspector enables you to inspect .NET Objects in the Smalltalk way.

.NET Workspace

The .NET Workspace enables you to create and to work with .NET Objects in the Smalltalk way.

Example 1: Creating a .NET Form, handling Events in Smalltalk

.NET Runtime Integration with STBC -> MSIL Translation

For "deep .NET Integration" we employ our Translation-Framework. Smalltalk-Code can be marked for translation to MSIL and saved into .NET Assemblies.

.NET Assemblies encapsulating the Deployment Smalltalk-Code and the Smalltalk-Virtual Machine can be generated.

Smalltalk-Modules which are translated are freezed in the sense that only a subset of Smalltalk is possible. Translated Smalltalk Classes must have been Type-Instantiated and such things like DNU are not available.

Smalltalk can be regarded as a Form of Generics for .NET

.NET Runtime Integration with LSWVST-VM Coexistence

Our Smalltalk-Virtual Machine has been extendend to coexist with .NET CLR. Smalltalk executes in our VM but we can callout to .NET The Smalltalk-VM lives in an unmanaged Assembly.