Front Page All Articles Recent Changes Random Article

Contents

Concatenative language

  • ACL
  • Ait
  • Aocla
  • Breeze
  • Callisto
  • Cat
  • Cognate
  • colorForth
  • Concata
  • CoSy
  • Deque
  • DSSP
  • dt
  • Elymas
  • Enchilada
  • ETAC
  • F
  • Factor
  • Fiveth
  • Forth
  • Fourth
  • Freelang
  • Gershwin
  • hex
  • iNet
  • Joy
  • Joy of Postfix App
  • kcats
  • Kitten
  • lang5
  • Listack
  • LSE64
  • Lviv
  • Meow5
  • min
  • Mirth
  • mjoy
  • Mlatu
  • Ode
  • OForth
  • Om
  • Onyx
  • Plorth
  • Popr
  • Porth
  • PostScript
  • Prowl
  • Quest32
  • Quackery
  • r3
  • Raven
  • Retro
  • RPL
  • SPL
  • Staapl
  • Stabel
  • Tal
  • Titan
  • Trith
  • Uiua
  • Worst
  • xs
  • XY
  • 5th
  • 8th

Concatenative topics

  • Compilers
  • Interpreters
  • Type systems
  • Object systems
  • Quotations
  • Variables
  • Garbage collection
  • Example programs

Concatenative meta

  • People
  • Communities

Other languages

  • APL
  • C++
  • Erlang
  • FP trivia
  • Haskell
  • Io
  • Java
  • JavaScript
  • Lisp
  • ML
  • Oberon
  • RPL
  • Self
  • Slate
  • Smalltalk

Meta

  • Search
  • Farkup wiki format
  • Etiquette
  • Sandbox

Factor/FAQ/Learning

How can I start learning Factor?

The best way to go about it is to figure out something you want to program and start trying to do it. Once you have a goal in mind, you can look at Factor's included documentation (available online at Factor's website), and ask questions on the Mailing list or Concatenative IRC channel.

Are there any good books I can read about Factor?

Factor is a very young language, and so far, there are no books which use it yet. A good introduction to Forth, much of which applies in Factor, is Thinking Forth (PDF) by Leo Brodie. The best place to start to learn about the principles of modern concatenative languages is the Joy papers, by Manfred von Thun. Another good internet resource is Planet Factor, a blog aggregator for all things Factor-related. There won't be a Factor book written until after Factor 1.0 is released.

How can I keep track of the stack in my head?

At first, it may be useful to make diagrams on paper. But eventually stack shufflers should fade away in your mind and become part of the data flow. If your stack is hard to trace, it is likely that you are thinking about too many things on the stack at once. It is highly unusual for a Factor word to accept or return more than three arguments on the stack. If you ever need to keep track of the location of more than three or four items, you should probably reorganize the function by factoring it into smaller pieces.

How can I improve my Factor coding style?

  • Most word definitions should fit in three or fewer 64-column lines.
  • Any copy/pasted code should be factored out into new words.
  • Use combinators to abstract control flow patterns.
  • Use library words where possible.
  • More general words should go at the top of a file; more specific at the bottom.
  • Try to use collections instead of working with individual objects on the stack.
  • Don't use the datastack as a data structure.
  • Use meaningful word names. Avoid too many words named (foo) or foo*.
  • A word named (foo) should only exist to help implement the word foo.
  • Come to the IRC channel and we'll review your code. It's fun!

This revision created on Mon, 5 Jan 2009 22:57:35 by slava

Latest Revisions Edit

All content is © 2008-2024 by its respective authors. By adding content to this wiki, you agree to release it under the BSD license.