Logo-small

5.1.4 VMMaker

VMaker is the package that contains the Slang part of the Object Engine and the tools necesary to translate Slang to C. In this section we describe the steps necesary to load it, what it contains, and how to make the Slang-to-C translation.

Load VMMaker in Pharo

An easy way to load VMMaker and plugins needed for Pharo is to use the Metacello ConfigurationOfVMMaker.

As of April 2010, version 1.3 of ConfigurationOfVMMaker is needed to build a VM based on squeak vm 4.0.3 revision 2202 source code.

Open a workspace in your Pharo image and evaluate:

 Gofer new
squeaksource: 'MetacelloRepository';
package: 'ConfigurationOfVMMaker';
load.

then

 (ConfigurationOfVMMaker project version: '1.3') load

What VMMaker contains

VMMaker consists of many subpackages, some of which are:

  • Building. Contains VMMaker and VMMakerTool classes (among others), which take care of translating and configuring the translation of the Slang respectively.
  • Interpreter. Contains ObjectMemory and Interpreter classes, which are the main classes of the OE. These two classes conform the Slang part of the engine.
  • Plugins. Plugins are extensions to the OE, they are also written in slang and get converted to C by VMMaker.

Translating Slang on linux

With VMMakerTool

VMMakerTool is a GUI front-end to configure VMMaker code generation. To open VMMakerTool evaluate:

 VMMakerTool openInWorld 

Then fill the form as follow (in order, use the buttons to the right):

  • Path to platforms: select the platforms directory of squeak vm source
  • Platform name:¬†target platform (Unix for GNU/Linux)
  • Path to generated source:¬†VMMaker will generate the source in this directory

VMMakerTool

Then comes the plugins selection. A simple and flexible configuration is to make all plugins external. Right-click on a plugin's panel and select make all external.

Select all plugins external

Some errors occur if UUIDPlugin is built externally. So until it's resolved, drag this plugin to internal.

A bug in unix makes it necessary to have at least one internal plugin and an external one. It doesn't matter which one, just make sure you have at least one external and one internal.

Then you can click on the Entire button to generate the interpreter and its plugins.

Without VMMakerTool

You can run VMMaker without the GUI tool. For example, to generate the interpreter with all plugins built externally (except UUIDPlugin and FT2Plugin), evaluate this:

 (VMMaker forPlatform: 'unix')
platformRootDirectoryName: '/path/to/platforms';
initializeAllExternalBut: #(UUIDPlugin FT2Plugin);
generateEntire.

Translating Slang on Mac OS

With VMMakerTool

VMMakerTool is a GUI front-end to configure VMMaker code generation. To open VMMakerTool evaluate:

 VMMakerTool openInWorld 

Then fill the form as follow:

  • Path to platforms: select the platforms directory of squeak vm source (i.e., it should point to the platform folder of the folder containing all the files ready for the XCode compilation - we called it myOwnVM in previous chapters)
  • Platform name: target platform Mac OS
  • Path to generated source: VMMaker will generate the source in this directory. We suggest you to make it point to MyOwnProject/src

Mac VMMaker look alike

Then comes the plugins selection. On Mac OS some plugins cannot be internal. Select make all internal, then remove the following plugins

Mac Plugins not build

Then you can click on the Entire button to generate the interpreter and its plugins.

Without VMMakerTool

You can run VMMaker without the GUI tool. For example, to generate the interpreter with all plugins built externally (except UUIDPlugin and FT2Plugin), evaluate this:

 (VMMaker forPlatform: 'unix')
platformRootDirectoryName: '/path/to/platforms';
initializeAllExternalBut: #(UUIDPlugin FT2Plugin);
generateEntire.

User Contributed Notes

elpochodelagente (19 June 2010, 12:24 pm)

I think this section should be placed before the #The GNU/Linux way# because that's the order of the build process:

1.Generate the sources,

2. Then compile.

Add a Note

Licensed under Creative Commons BY-NC-SA | Published using Pier |