Working on AjTalk, Smalltalk-like VM written in C#

These days, I’m working in my pet project AjTalk, an Smalltalk-like VM written in C#. Past year, I wrote some post about the project. It’s time to refresh the status of the project: it can manage many VM is one .NET process, has agents, parallel processing, distributed objects, and access to .NET class library. This post is an intro to its base types.

You can download the source code (Work in progress) from:

The current aspect of the solution (written using Visual Studio 2008):

The core library is AjTalk, and all its code was written using TDD. The tests are in AjTalk.Tests project.

AjTalk is prepared to manage its own kind of objects, that implements IObject interface:

and it can manage .NET native types and objects, too. Strings, integers, and numbers are created and managed as .NET native objects. I should write a dedicated post about the current implementation to create and access these native objects.

The main implementation of IObject is BaseObject. Internally, it keeps a reference to an IBehavior object and an internal array of instance variables:

    public class BaseObject : IObject, ISerializable
        private IBehavior behavior;
        private object[] variables;
        public BaseObject()
            this.behavior = null;
            this.variables = null;
        public BaseObject(IBehavior behavior, int nvars)
            this.behavior = behavior;
            this.variables = new object[nvars];

Note that the instances variables are not instances of IObject: they are objects, so they can reference any native .NET objects or AjTalk IObjects. I had plans to access native objects via a decorator that implements IObject, but I decided to reference them directly.

IBehavior is defined as:

Its main responsibility is to define and retrieve methods by name, create objects, and keep the superclass hierarchy. The methods are implementation of IMethod, derived from IBlock:

Currently, all these interfaces are implemented using native classes. In this way, I can use it without having an AjTalk class library written in the same language. It’s a sort of scaffolding: a way to have an initial base to build over the rest of the language.

201 tests, all green:

Good code coverage, I could improve the number:

Next topics to explore: Machine implementation, Blocks, access to .NET types and objects, agents, distributed objects, and transactional objects (Work in progress).

Keep tuned!

Angel “Java” Lopez

2 thoughts on “Working on AjTalk, Smalltalk-like VM written in C#

  1. German Arduino

    Indeed is an interesting idea (at least to me as Smalltalker) any sort of Smalltalk experiment.

    I’m not able to follow this more than reading because I don’t use VStudio, but will continue reading the progress.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s