Other languages
Computer Science
Meta
What makes Factor unique?
Factor combines traits which are rarely all seen together in the same language:
What is Factor's specialty? Where is it best used?
Factor can be used for anything. Factor has been used for everything from scripting, web applications (see Furnace), games, and XML parsers.
What is Factor's purpose?
Factor is an experiment to build a modern, useful Concatenative language with strong abstraction capabilities. Factor is particularly good at Interactive development.
Why is Factor stack-based?
Concatenative and stack-based languages have not received much attention from the programming community ever since Forth began a slow decline in the 80's. The Concatenative language page discusses some advantages of this programming paradigm. Once you learn some common idioms, many problems can be more cleanly expressed in a concatenative language compared to an applicative language.
Is Factor suitable for implementing my next program?
Probably. There are only a couple places where it might not work. For example, you'll never be able to program your TI-83 calculator in Factor, because it has a footprint at least as big as the image, which means at least 500 Kb for most programs, even with a minimal image. You might have a hard time writing a boot loader or other low-level code in Factor. But for everything else, it should be usable.
Is Factor cross-platform?
Though Factor images can only run on one specific platform, the same Factor source code can easily be run on any platform that Factor is ported to. Portability issues only occur when interfacing with native libraries, or if there is a bug.
How is Factor different from Forth?
Forth is untyped, not garbage collected, and close to the machine. For flow control, Forth code tends to use immediate words. Variables and arrays tend to be global, and programs aren't usually written in a functional manner. Factor is very different from this. It is dynamically typed, offering a high degree of reflection. Unreferenced objects are garbage collected with a generational garbage collector. Factor code is a little bit more distant from the machine, though the C FFI allows using words like malloc
and mmap
. For flow control, Factor generally uses quotations, allowing flexible higher order functions; parsing words are used mostly for definitions and data literals. Variables are dynamically or statically scoped (see below), and arrays are just objects which don't need to be treated specially.
If Factor programs are just compositions of existing words, how is Factor as powerful as other programming languages?
Factor is a Turing-complete programming language whose programs are capable of doing whatever any other programming language can do. In fact, it isn't all that complicated to translate between a stack-based language and an applicative one, as long as it's known how many arguments the words in the stack-based language take.
Why do we need a new stack-based language?
Because the other ones aren't suitable for high-level development. Forth is great for low-level things, but its lack of type system and garbage collection make it difficult to debug programs, and it doesn't mesh well with functional programming. Joy made a very important theoretical contribution, but it is difficult to compile efficiently, its syntax is inextensible and it has an insufficient module system. Additionally, it is almost purely functional, making many things difficult. Factor combines the best aspects of these two systems, together many other borrowings from various places.
This revision created on Mon, 28 Dec 2009 12:40:46 by slava