]> gitweb.factorcode.org Git - factor.git/blob - README.md
Adding a readme that github can understand.
[factor.git] / README.md
1 # Factor
2
3 The Factor programming language combines [powerful language
4 features](http://concatenative.org/wiki/view/Factor/Features/The%20language)
5 with a [full-featured
6 library](http://docs.factorcode.org/content/article-vocab-index.html). The
7 implementation is [fully
8 compiled](http://concatenative.org/wiki/view/Factor/Optimizing%20compiler)
9 for performance, while still supporting [interactive
10 development](http://concatenative.org/wiki/view/Factor/Interactive%20development).
11 Factor applications are portable between all common platforms.  Factor can
12 [deploy stand-alone
13 applications](http://concatenative.org/wiki/view/Factor/Deployment) on all
14 platforms.  Full source code for the Factor project is available under a BSD
15 license.
16
17 ## Getting Started
18
19 If you are reading this README file, you either downloaded a binary
20 package, or checked out Factor sources from the GIT repository.
21
22 * [Learning Factor](http://concatenative.org/wiki/view/Factor/Learning)
23 * [System requirements](http://concatenative.org/wiki/view/Factor/Requirements)
24 * [Building Factor from source](http://concatenative.org/wiki/view/Factor/Building%20Factor) (don't do this if you're using a binary package)
25
26 To run Factor:
27
28 * Windows: Double-click `factor.exe`, or run `.\factor.com` in a command prompt
29 * Mac OS X: Double-click `Factor.app` or run `open Factor.app` in a Terminal
30 * Unix: Run `./factor` in a shell
31
32 A tutorial is available that can be accessed from the Factor environment:
33
34 ```factor
35 "first-program" help
36 ```
37
38 Some other simple things you can try in the listener:
39
40 ```factor
41 "Hello, world" print
42
43 { 4 8 15 16 23 42 } [ 2 * ] map .
44
45 1000 [1,b] sum .
46
47 4 iota  [
48     "Happy Birthday " write
49     2 = "dear NAME" "to You" ? print
50 ] each
51 ```
52
53 ## Documentation
54
55 The Factor environment includes extensive reference documentation and a
56 short "cookbook" to help you get started. The best way to read the
57 documentation is in the UI; press F1 in the UI listener to open the help
58 browser tool. You can also [browse the documentation
59 online](http://docs.factorcode.org).
60
61 ## Command Line Usage
62
63 Factor supports a number of command line switches:
64
65 ```
66 Usage: factor [Factor arguments] [script] [script arguments]
67
68 Common arguments:
69     -help            print this message and exit
70     -i=<image>       load Factor image file <image> (default factor.image)
71     -run=<vocab>     run the MAIN: entry point of <vocab>
72         -run=listener    run terminal listener
73         -run=ui.tools    run Factor development UI
74     -e=<code>        evaluate <code>
75     -no-user-init    suppress loading of .factor-rc
76
77 Enter
78     "command-line" help
79 from within Factor for more information.
80 ```
81
82 You can also write scripts that can be run from the terminal, by putting
83 ``#!/path/to/factor`` at the top of your scripts and making them executable.
84
85 ## Source Organization
86
87 The Factor source tree is organized as follows:
88
89 * `build-support/` - scripts used for compiling Factor (not present in binary packages)
90 * `vm/` - Factor VM source code (not present in binary packages)
91 * `core/` - Factor core library
92 * `basis/` - Factor basis library, compiler, tools
93 * `extra/` - more libraries and applications
94 * `misc/` - editor modes, icons, etc
95 * `unmaintained/` - unmaintained contributions, please help!
96
97 ## Community
98
99 Factor developers meet in the `#concatenative` channel on
100 [irc.freenode.net](http://freenode.net). Drop by if you want to discuss
101 anything related to Factor or language design in general.
102
103 * [Factor homepage](http://factorcode.org)
104 * [Concatenative languages wiki](http://concatenative.org)
105
106 Have fun!