Guided tour of Factor
Factor handbook

Prev:Your first program
Next:The language


Factor is a mature, dynamically typed language based on the concatenative paradigm. Getting started with Factor can be daunting since the concatenative paradigm is different from most mainstream languages. This tutorial will:
Guide you through the basics of Factor so you can appreciate its simplicity and power.
Show you that Factor can be mastered with a bit of practice.
Assume some familiarity with programming.

Even though Factor is a niche language, it is mature and has a comprehensive standard library covering tasks from JSON serialization to socket programming and HTML templating. It runs in its own optimized VM with very high performance for a dynamically typed language. It also has a flexible object system, a Foreign Function Interface to C, and asynchronous I/O that works a bit like Node.js, but with a much simpler model for cooperative multithreading.

Factor has a few significant advantages over other languages, most arising from the fact that it has essentially no syntax:
Refactoring is very easy, leading to short and meaningful function definitions
It is extremely succinct, letting the programmer concentrate on what is important instead of boilerplate
It has powerful metaprogramming capabilities, exceeding even those of LISPs
It is ideal for creating DSLs
It integrates easily with powerful tools

A few file paths in the examples may need to be adjusted based on your system.

The first section gives some motivation for the peculiar model of computation of concatenative languages, but feel free to skip it if you want to get your feet wet and return to it after some hands on practice with Factor.

The Tour
Image Concatenative Languages
Image Playing with the stack
Image Defining our first word
Image Parsing Words
Image Stack Shuffling
Image Combinators
Image Vocabularies
Image Tests and Documentation
Image The Object System
Image Learning the Tools
Image Metaprogramming
Image When the stack is not enough
Image Input/Output
Image Deploying programs
Image Multithreading
Image Servers and Furnace
Image Processes and Channels
Image Where to go from here?