Angel \”Java\” Lopez on Blog

November 29, 2012

Working on AjTalk: Smalltalk VM, C# version

Filed under: AjTalk, C Sharp, Open Source Projects, Programming Languages, Smalltalk — ajlopez @ 4:56 pm

After working on my Node.js distributed examples (Genetic Algorithms), and my Python interpreter (Spanish Post, GitHub repo), I went back to work on AjTalk, my Smalltalk VM implementation. I have three projects (C# version, Java version, JavaScript/NodeJs version), but now I’m working on the C# one.

The past weeks, I added a simple/naive but functional save/load binary images, and I have a new bytecode compiler: instead of parsing code and directly generates the bytecodes, AjTalk builds an AST-like structure in memory, and using visitors, it can generate the bytecodes (past year, I had implemented a visitor that transforms the AST to JavaScript code, to use in my JavaScript VM version). The visitor pattern could be used to generate different outcomes using the same AST input (litmus test: a third visitor generating Python, Ruby or C# code (in this case, using dynamic objects)).

I can load more than one Machine at the same time: in my jargon, a Machine has the objects and classes of a living image. Instead of being a singleton, I can create, populate and load from images more than a Machine. The main code at:

https://github.com/ajlopez/AjTalk/blob/master/Src/AjTalk/Machine.cs

I could generate a minimal image for a hello world (< 300 bytes!), see the code at:

https://github.com/ajlopez/AjTalk/blob/master/Src/AjTalk.Console/Programs/HelloWorld.st

I exercised the parsers loading and executing the Pharo file outs:

https://github.com/ajlopez/AjTalk/blob/master/Src/AjTalk.Tests/CodeFiles/PharoCoreKernelObjects.st
https://github.com/ajlopez/AjTalk/blob/master/Src/AjTalk.Tests/CodeFiles/PharoKernelNumbers.st
https://github.com/ajlopez/AjTalk/blob/master/Src/AjTalk.Tests/CodeFiles/PharoKernelClasses.st

All written using TDD, as usual :-)

Now I have many machines in memory, I would like to implement this idea:

- Load a Machine A (with its classes, methods, objects) having a complete class library
- Load a Machine B, having only some classes and objects
- Set Machine A to be the host of Machine B.
- Reimplement #doesNotUnderstand message processing in Machine B so, if a message is not located in that machine, the search of the corresponding method continues in the similar classes at Machine A. In this way, I could use all the power of Machine A, to operate on a slim Machine B. Machine A could have all the development tools/classes/methods, meanwhile Machine B still have a minimal size. A similar ideas is being explored by @morplenauta (Squeak committer), see Spanish email list.

Another project: to have a minimal static files web server, using native .NET objects (System.NET).

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

1 Comment »

  1. Then it is important to apply general amount involving any medical cream like Clearasil on
    your own face. After all, they can be readily sourced from the internet.
    But since something was happening I decided to
    keep trying for a few more nights.

    Comment by Mole Removal — May 2, 2013 @ 11:55 pm


RSS feed for comments on this post. TrackBack URI

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

The Shocking Blue Green Theme Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 56 other followers

%d bloggers like this: