3 [![](https://api.travis-ci.org/factor/factor.svg)](https://travis-ci.org/factor/factor)
5 Factor is a [concatenative](https://www.concatenative.org), stack-based
6 programming language with [high-level
7 features](https://concatenative.org/wiki/view/Factor/Features/The%20language)
8 including dynamic types, extensible syntax, macros, and garbage collection.
9 On a practical side, Factor has a [full-featured
10 library](https://docs.factorcode.org/content/article-vocab-index.html),
11 supports many different platforms, and has been extensively documented.
13 The implementation is [fully
14 compiled](https://concatenative.org/wiki/view/Factor/Optimizing%20compiler)
15 for performance, while still supporting [interactive
16 development](https://concatenative.org/wiki/view/Factor/Interactive%20development).
17 Factor applications are portable between all common platforms. Factor can
19 applications](https://concatenative.org/wiki/view/Factor/Deployment) on all
20 platforms. Full source code for the Factor project is available under a BSD
25 ### Building Factor from source
27 If you have a build environment set up, then you can build Factor from git.
28 These scripts will attempt to compile the Factor binary and bootstrap from
29 a boot image stored on factorcode.org.
33 * `git clone git://github.com/factor/factor.git`
36 To build the latest complete Factor system from git, either use the
39 * Unix: `./build.sh update`
40 * Windows: `build.cmd`
42 or download the correct boot image for your system from
43 http://downloads.factorcode.org/images/master/, put it in the `factor`
46 * Unix: `make` and then `./factor -i=boot.unix-x86.64.image`
47 * Windows: `nmake /f Nmakefile x86-64` and then `factor.com -i=boot.windows-x86.64.image`
49 Now you should have a complete Factor system ready to run.
51 More information on [building factor](https://concatenative.org/wiki/view/Factor/Building%20Factor)
52 and [system requirements](https://concatenative.org/wiki/view/Factor/Requirements).
54 ### To run a Factor binary:
56 You can download a Factor binary from the grid on [https://factorcode.org](https://factorcode.org).
57 The nightly builds are usually a better experience than the point releases.
59 * Windows: Double-click `factor.exe`, or run `.\factor.com` in a command prompt
60 * Mac OS X: Double-click `Factor.app` or run `open Factor.app` in a Terminal
61 * Unix: Run `./factor` in a shell
65 A tutorial is available that can be accessed from the Factor environment:
71 Some other simple things you can try in the listener:
76 { 4 8 15 16 23 42 } [ 2 * ] map .
81 "Happy Birthday " write
82 2 = "dear NAME" "to You" ? print
86 For more tips, see [Learning Factor](https://concatenative.org/wiki/view/Factor/Learning).
90 The Factor environment includes extensive reference documentation and a
91 short "cookbook" to help you get started. The best way to read the
92 documentation is in the UI; press F1 in the UI listener to open the help
93 browser tool. You can also [browse the documentation
94 online](https://docs.factorcode.org).
98 Factor supports a number of command line switches:
101 Usage: factor [Factor arguments] [script] [script arguments]
104 -help print this message and exit
105 -i=<image> load Factor image file <image> (default factor.image)
106 -run=<vocab> run the MAIN: entry point of <vocab>
107 -run=listener run terminal listener
108 -run=ui.tools run Factor development UI
109 -e=<code> evaluate <code>
110 -no-user-init suppress loading of .factor-rc
111 -roots=<paths> a list of path-delimited extra vocab roots
115 from within Factor for more information.
118 You can also write scripts that can be run from the terminal, by putting
119 ``#!/path/to/factor`` at the top of your scripts and making them executable.
121 ## Source Organization
123 The Factor source tree is organized as follows:
125 * `vm/` - Factor VM source code (not present in binary packages)
126 * `core/` - Factor core library
127 * `basis/` - Factor basis library, compiler, tools
128 * `extra/` - more libraries and applications
129 * `misc/` - editor modes, icons, etc
130 * `unmaintained/` - now at [factor-unmaintained](https://github.com/factor/factor-unmaintained)
134 During Factor's lifetime, sourcecode has lived in many repositories. Unfortunately, the first import in Git did not keep history. History has been partially recreated from what could be salvaged. Due to the nature of Git, it's only possible to add history without disturbing upstream work, by using replace objects. These need to be manually fetched, or need to be explicitly added to your git remote configuration.
137 `git fetch origin 'refs/replace/*:refs/replace/*'`
139 or add the following line to your configuration file
144 fetch = +refs/heads/*:refs/remotes/origin/*
146 fetch = +refs/replace/*:refs/replace/*
149 Then subsequent fetches will automatically update any replace objects.
153 Factor developers meet in the `#concatenative` channel on
154 [irc.freenode.net](http://freenode.net). Drop by if you want to discuss
155 anything related to Factor or language design in general.
157 * [Factor homepage](https://factorcode.org)
158 * [Concatenative languages wiki](https://concatenative.org)
159 * [Mailing list](factor-talk@lists.sourceforge.net)
160 * Search for "factorcode" on [Gitter](https://gitter.im/)