Monday, April 28, 2008

Revised view of native code generator

Earlier, in my previous posts about ASM-generator i made something which can be used in practice, but still lacks of fundamental point: the VM support.
A new idea was born: since everything can be compiled down to native code, why we need to use C at all? I started things from the scratch and came up with new design of system where everything will be dynamically compiled and residing in object memory.

Here is some features of new meta-circular VM:

- all functionality, what we know as 'VM' will become a part of object memory with own classes and methods.

- for starting an image you will need a tiny bootstrapper written in C which mainly serves as image loader and provides basic compatibility layer with few OS-specific functions required to bootstrap VM. For calling C functions from VM there will be FFI layer, which should be used by any parts of system which require external libraries or OS-specific functions.

- there is no 'primitives' as in another ST implementations. All methods are compiled down to native code. For writing a low-level code, there is a special methods in native format. As with ASM-generator, in native methods you operating with machine registers/values , not with real objects, which allows you to implement almost anything from scratch, without writing a single line of C code.

Watch for the updates at wiki page:
http://wiki.squeak.org/squeak/6041

1 comment:

Anonymous said...

Well written article.