Factor (programming language)

This is an old revision of this page, as edited by 24.68.131.208 (talk) at 01:26, 4 April 2006 (grammar typo fix). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Factor is a concatenative programming language designed and implemented by Slava Pestov. Factor's main influences are Joy, Forth, and Lisp, with minor influence from Self.

Like other concatenative languages, Factor has a postfix syntax, meaning that you write the arguments of a function before the function name. As an example, Hello world in Factor is

"Hello world" print

Factor is dynamically typed, and a unique object system accompanies it. In Factor, there are more than 20 base types, and users can make their own datatypes using tuples. There is no inheritance, but there is delegation as in Self. Additionally, there are other ways to make classes other than types or tuples; Factor supports predicate classes and union classes. Factor's integrated compound datatypes include linked lists, vectors and hashtables. The language also supports floating point, ratios, complex numbers and arbitrary precision integers.

When using the stack system does not suffice, dynamic scoping is a supported alternative. Factor has a growing library which supports continuations, an HTTP server, an SDL binding and a GUI library.

One of Factor's main goals is to be useful for interactive and test-driven development, which is why Factor is, at its core, a safe version of Forth.

So far, both Java and C implementations have been constructed (the Java implementation is deprecated).