When to Bootstrap
From SlateWiki
Often when adding behavior to the standard libraries of Slate, you might wonder what the easiest way to get this done is. Slate's bootstrapping process is very thorough, but it takes a lot of time to complete.
| Table of contents |
Code updates or additions
If your code merely updates or adds methods, you can usually just paste the new code into the Slate REPL and then save the image.
Changes to the post-bootstrap files
If you are just changing the contents of a file loaded when building a full image from the distributed core images, you can just re-run the VM with the core images and it will repeat the process and load your code freshly.
If you only want to customize the list of files loaded on the distribution core image start-up, just edit src/mobius/vm/post-bootstrap.slate to include whatever libraries you find useful. You will have to perform a full bootstrap of new images and VM as described below, since the post-bootstrap is hardcoded into the core images currently, but with minor changes like this there is little risk of failure.
Plugins
If you just need to build a plugin to access some optional binding to an external library or fast-compiled routines, use the src/plugins/ directory structure and use an existing plugin as a template, with its own Makefile. Then the make plugins directive will work on it as well.
VM changes
If you need to build a modified or extended virtual machine (the details of modification involved are described in the Mobius manual) or core image, there is a more involved process called bootstrapping. Simply execute:
load: 'src/mobius/init.slate'. VM define: #new -> (VM Definition newNamed: 'vm.new') generate.
If the VM's interface somehow changes: added primitives or modified image format of some sort, an image which links to that VM interface must be built within a Slate system that has that VM's information. This means that you should execute the following, within the same image that the VM was built, after the VM build (substituting the correct endianness value for your platform):
(Image Definition newNamed: 'big.new.image' basedOn: VM new &littleEndian: False) generate.
and then repeat the instructions above to build the virtual machine, with appropriately-changed options as necessary. However, even if you only modify the image, it must still be built within a Slate system which has created a VM definition and stored it, as that information is re-used to define the image.
Systematic Changes
If you need to produce both a new VM and new images you can do both in a single step with:
load: 'src/mobius/init.slate'. fullCleanBootstrap.
make newboot automates this. This will produce both big and little images however so you may find it faster to generate the VM and image seperately as outlined above. This method also saves a boot.image file, which will begin executing the specific image-generation code (skipping the VM generation) when you start Slate with it.
