Factor/FAQ/Install

How do I download and install Factor?

The simplest way is to use Binaries. You can also compile sources from the GIT repository.

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 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 make-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.

When I try to bootstrap I get an out of memory error

If you see something like this,

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 "\u00000c"

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 packages for libc, Freetype, X11, and OpenGL. For more detailed instructions, see Requirements.

I'm trying to compile Factor on Cygwin and I get compile errors regarding Boost. How do I solve this?

Factor requires boost::unordered_map when being compiled with GCC 3.x. When compiling with GCC 4.x, std::tr1::unordered_map is used, which is part of GCC, but Cygwin ships GCC 3.4.4 by default, which doesn't have std::tr1, so Factor uses Boost instead. You need to download Boost and place the headers in /usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/. Note that Cygwin ships an old version of Boost, so you will need to download and install Boost yourself, instead of using Cygwin's installer.

Does Factor run on ARM-based computers, such as the iPhone?

No. It used to, but the port is not being maintained anymore. To make a truly useful ARM port, Factor would need to support cross-compilation and effort would need to be invested in reducing memory usage, both of which are non-trivial projects that would take up a lot more time than developing the actual ARM compiler backend itself. Due to time and resource constraints, we probably won't revive the ARM port unless there is commercial interest in running Factor on such devices.

This revision created on Fri, 22 Mar 2013 20:59:24 by mrjbq7