Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 132 lines (93 sloc) 4.365 kB
9a2e425 @mrjbq7 Adding a readme that github can understand.
mrjbq7 authored
1 # Factor
2
840c7b7 @mrjbq7 README: minor introduction changes.
mrjbq7 authored
3 Factor is a [concatenative](http://www.concatenative.org), stack-based
4 programming language with [high-level
9a2e425 @mrjbq7 Adding a readme that github can understand.
mrjbq7 authored
5 features](http://concatenative.org/wiki/view/Factor/Features/The%20language)
840c7b7 @mrjbq7 README: minor introduction changes.
mrjbq7 authored
6 including dynamic types, extensible syntax, macros, and garbage collection.
7 On a practical side, Factor has a [full-featured
8 library](http://docs.factorcode.org/content/article-vocab-index.html),
9 supports many different platforms, and has been extensively documented.
10
11 The implementation is [fully
9a2e425 @mrjbq7 Adding a readme that github can understand.
mrjbq7 authored
12 compiled](http://concatenative.org/wiki/view/Factor/Optimizing%20compiler)
13 for performance, while still supporting [interactive
14 development](http://concatenative.org/wiki/view/Factor/Interactive%20development).
15 Factor applications are portable between all common platforms. Factor can
16 [deploy stand-alone
17 applications](http://concatenative.org/wiki/view/Factor/Deployment) on all
18 platforms. Full source code for the Factor project is available under a BSD
19 license.
20
21 ## Getting Started
22
e4a2d86 @erg README.md: Don't assume the user has downloaded Factor yet. Instructi…
erg authored
23 ### Building Factor from source
24
25 If you have a build environment set up, then you can build Factor from git.
26 These scripts will attempt to compile the Factor binary and bootstrap from
27 a boot image stored on factorcode.org.
28
29 To check out Factor:
30
0405b6c @erg README.md: A few more cleanups suggested by @mrjbq7.
erg authored
31 * `git clone git://factorcode.org/git/factor.git`
32 * `cd factor`
e4a2d86 @erg README.md: Don't assume the user has downloaded Factor yet. Instructi…
erg authored
33
34 To build the latest complete Factor system from git:
35
0405b6c @erg README.md: A few more cleanups suggested by @mrjbq7.
erg authored
36 * Windows: `build-support\factor.cmd`
37 * Unix: `./build-support/factor.sh update`
e4a2d86 @erg README.md: Don't assume the user has downloaded Factor yet. Instructi…
erg authored
38
39 Now you should have a complete Factor system ready to run.
40
0405b6c @erg README.md: A few more cleanups suggested by @mrjbq7.
erg authored
41 More information on [building factor](http://concatenative.org/wiki/view/Factor/Building%20Factor)
42 and [system requirements](http://concatenative.org/wiki/view/Factor/Requirements).
e4a2d86 @erg README.md: Don't assume the user has downloaded Factor yet. Instructi…
erg authored
43
44 ### To run a Factor binary:
45
46 You can download a Factor binary from the grid on [http://factorcode.org](http://factorcode.org).
47 The nightly builds are usually a better experience than the point releases.
9a2e425 @mrjbq7 Adding a readme that github can understand.
mrjbq7 authored
48
49 * Windows: Double-click `factor.exe`, or run `.\factor.com` in a command prompt
50 * Mac OS X: Double-click `Factor.app` or run `open Factor.app` in a Terminal
51 * Unix: Run `./factor` in a shell
52
e4a2d86 @erg README.md: Don't assume the user has downloaded Factor yet. Instructi…
erg authored
53 ### Learning Factor
54
9a2e425 @mrjbq7 Adding a readme that github can understand.
mrjbq7 authored
55 A tutorial is available that can be accessed from the Factor environment:
56
57 ```factor
58 "first-program" help
59 ```
60
61 Some other simple things you can try in the listener:
62
63 ```factor
64 "Hello, world" print
65
66 { 4 8 15 16 23 42 } [ 2 * ] map .
67
68 1000 [1,b] sum .
69
70 4 iota [
71 "Happy Birthday " write
72 2 = "dear NAME" "to You" ? print
73 ] each
74 ```
75
0405b6c @erg README.md: A few more cleanups suggested by @mrjbq7.
erg authored
76 For more tips, see [Learning Factor](http://concatenative.org/wiki/view/Factor/Learning).
77
9a2e425 @mrjbq7 Adding a readme that github can understand.
mrjbq7 authored
78 ## Documentation
79
80 The Factor environment includes extensive reference documentation and a
81 short "cookbook" to help you get started. The best way to read the
82 documentation is in the UI; press F1 in the UI listener to open the help
83 browser tool. You can also [browse the documentation
84 online](http://docs.factorcode.org).
85
86 ## Command Line Usage
87
88 Factor supports a number of command line switches:
89
90 ```
91 Usage: factor [Factor arguments] [script] [script arguments]
92
93 Common arguments:
94 -help print this message and exit
95 -i=<image> load Factor image file <image> (default factor.image)
96 -run=<vocab> run the MAIN: entry point of <vocab>
97 -run=listener run terminal listener
98 -run=ui.tools run Factor development UI
99 -e=<code> evaluate <code>
100 -no-user-init suppress loading of .factor-rc
101
102 Enter
103 "command-line" help
104 from within Factor for more information.
105 ```
106
107 You can also write scripts that can be run from the terminal, by putting
108 ``#!/path/to/factor`` at the top of your scripts and making them executable.
109
110 ## Source Organization
111
112 The Factor source tree is organized as follows:
113
114 * `build-support/` - scripts used for compiling Factor (not present in binary packages)
115 * `vm/` - Factor VM source code (not present in binary packages)
116 * `core/` - Factor core library
117 * `basis/` - Factor basis library, compiler, tools
118 * `extra/` - more libraries and applications
119 * `misc/` - editor modes, icons, etc
120 * `unmaintained/` - unmaintained contributions, please help!
121
122 ## Community
123
124 Factor developers meet in the `#concatenative` channel on
125 [irc.freenode.net](http://freenode.net). Drop by if you want to discuss
126 anything related to Factor or language design in general.
127
128 * [Factor homepage](http://factorcode.org)
129 * [Concatenative languages wiki](http://concatenative.org)
130
131 Have fun!
Something went wrong with that request. Please try again.