Introduction to Smalltalk MT

Home | Up | Search | X-Zone News | Services | Book Support | Links | Feedback | Smalltalk MT | The Scrapyard | FAQ | Technical Articles


Smalltalk MT

What is Smalltalk MT

Smalltalk MT is a language just like C++. Smalltalk MT compiles and produces an executable or DLL or COM component that can function exactly like a C++ created component. There are differences in the language and differences in the development environment that allow Smalltalk to compliment C++ development.

Smalltalk MT uses the Smalltalk language that is absolutely consistent in its approach. C++ uses both methods and functions because of the C history which was entirely function based. Smalltalk MT uses only methods. Statements are always of the form 'receiver method'.

C++ syntax Smalltalk MT syntax
out->tv_sec = in->hour * 3600 + i / MILLION; out tv_sec: in hour * 3600 + (i/MILLION).
if ( ! m_pSession->CreateSessionFromDialogs() ) {
return FALSE;
m_psession createSessionFromDialogs ifFalse: [^false].

So why invent a difference?  The reason for the difference is that Smalltalk was always an Object Oriented language and Objects are used as the underlying execution engine. C++ on the other hand was extended from C to include Objects.

When Smalltalk sees the expression 'a + b / c + d' it sees the expression from left to right with each result becoming the receiver of the next message. Because of this, you must provide parenthesis if you want to change the execution order.

When C/C++ sees the expression 'a + b / c + d' it actually sees 'a + (b / c) + d' because the compiler provides operator precedence outside of our view.

Why would I consider using Smalltalk MT?

The Smalltalk Development Environment is a different model from the C++ development environment. In Visual Studio, the source code lives in the Development Environment and the resulting program is compiled and executed outside of Visual Studio. You can use Edit and Continue and the debugger to interrupt the execution of the external program but the program is still an external process from Visual Studio.

The Smalltalk Development Environment runs your program as part of the same process. You can still compile and run an external program, but during development you file in (compile) projects into the Development Environment and run them. This means several differences:

bulletThe is no compile, link, run cycle. Once the program has been filed into the Development Environment, it can be instantaneously changed and executed. Each method that is changed and saved is instantly compiled and available.
bulletCode can be changed as the program is running allowing instant testing.
bulletCode can be executed in workspaces to test out execution before introduction into a program.
bulletA change log keeps track of all method changes allowing recovery from unforeseen issues
bulletThe Smalltalk Development Environment requires less configuration than Visual Studio avoiding issues with Library order or position of Include files.

These differences mean that code can be rapidly prototyped and tested before settling into its final form. For example, assume you were trying to find the perfect texture stage states for a DX8 scene. Setting up this scene in Smalltalk MT is extremely fast . Then you could play around with the texture stage states as the program is running to find the effect on frame rates and effects on the scene. Each time you change a method, saving the method compiles it and makes it instantly available (as machine code) to the running program.

Can I build DirectX 8 games with Smalltalk MT?

Absolutely. We have ported a number of the DirectX 8 SDK samples to Smalltalk MT to help you understand the differences. Smalltalks strength is in Simulation and Strategy

Can I still use Visual Studio?

Of course. We use both Visual Studio and Smalltalk MT in development. Smalltalk MT is ideal for complex application (such as simulations) pieces. Visual Studio is ideal for building support libraries and for managing resources. These are complimentary tools especially in the area of Game development.

I am a newbie to DirectX 8. Will Smalltalk MT help me?

We believe that people new to DirectX 8 will benefit greatly from Smalltalk MT. Because the environment is less complex than Visual Studio, Smalltalk MT lets you get into DirectX 8 faster. Smalltalk MT also uses the native DX8 library not the Visual Basic DX8 Library. This means that you will become familiar with the whole DX8 library without any limitations.

What is in this evaluation version?

This is a complete installation that allows you full access to the development environment. The only restriction is the ability to build standalone executables, DLL or COM components. To do that costs $99 and provides a registration key. For the evaluation key, use all 1's.

The subdirectories include both samples and extras. Projects have the extension .sp or .spx and these can be loaded into the project browser. Use File In to bring them into the development environment.


This site, created by DirectX MVP Robert Dunlop and aided by the work of other volunteers, provides a free on-line resource for DirectX programmers.

Special thanks to WWW.MVPS.ORG, for providing a permanent home for this site.

Visitors Since 1/1/2000: Hit Counter
Last updated: 07/26/05.