Concatenative topics
Concatenative meta
Other languages
Meta
What's an image? Why does Factor use one?
The image is the file that Factor uses to store all code and data when Factor isn't running. The Factor executable and dynamically linked library only have a small amount of knowledge about Factor--just the virtual machine, the primitives and the structure of the image. The entire library is contained in the image, and was loaded there during the bootstrap process. The image is a map of the memory after the code was loaded. Unlike in Smalltalk, Factor code is almost always distributed in files rather than in the image.
What is bootstrapping, and why do I need a boot image for it?
In general, bootstrapping is the process of compiling a self-hosted compiler, that is, a compiler written in the programming language it compiles. Though Factor isn't entirely self-hosted, we use a bootstrapping process as many important pieces, like the compiler and parser (but not the virtual machine or primitives) are written in Factor. Years ago, there was a Factor interpreter and compiler written in Java, and that was initially used to run the Factor code we use now, creating an image. Now, we use a boot image--a kind of mini-image which has just enough knowledge to start the process to create a full image.
How can I make a boot image?
Use the word >gmake-image
, as in "x86.32" make-image
. This creates a file boot.x86.32.image
in the current directory which is a full boot image. For a listing of the strings needed to specify architecture, see the help file by running make-image help
at the listener. You can also get boot images from the Factor website, if you can't make one yourself.
Once I have a boot image, how do I compile and bootstrap Factor?
Here is the series of commands used to compile Factor on a 32-bit x86 computer:
make ./factor -i=boot.x86.32.image #replace 'x86.32' with the appropriate architecture's string
Should I use the last stable version of Factor, or track the current development with git?
The only advantage of git is that you can do >ggit pull
, that is, you can update your code from any git server (not just the main one) and have the contents be in the same directory as they were before. Developers who want to make contributions should use git and maintain a git server.
When I try to bootstrap I get the following output:
Loading P" factor.image" *** Data heap resized to 196104192 bytes *** Data GC (2 minor, 10 cards) *** Data heap resized to 630124544 bytes *** Data GC (0 minor, 0 cards) P" factor.image":1 ^ Word not found in current vocabulary search path no-word-name "\u000c"
You are passing the boot image name to the Factor executable
incorrectly. The correct syntax is to pass the image name as an -i=
parameter, e.g. ./factor -i=boot.x86.32.image.
Which libraries do I need to get the UI working with X11 on Linux?
You need to install recent development libraries for libc, Freetype, X11, OpenGL and GLUT. On a Debian-derived Linux distribution (like Ubuntu), you can use the line
sudo apt-get install libc6-dev libfreetype6-dev libx11-dev glutg3-dev
This revision created on Mon, 5 Jan 2009 18:20:42 by littledan