tags:

views:

957

answers:

5

Having recently come across this introduction to Factor, I've been a bit curious to learn more. Aside from the official FAQ mentioned there, do you have resources for learning the language (as well as the stack-based "paradigm," if that's the right word) that you've found helpful?

As a side note, would learning Forth help, or is that like comparing C to Python (or what have you)?

+4  A: 

You can start here: http://concatenative.org/wiki/view/Factor

And there's a nice documentation included in the runtime/GUI. Just install and then "Browser" and you see the documentation with topics like "Your first program".

The documentation is available online, too: http://docs.factorcode.org/
(It's the same as the one you get when you install Factor.)

Don't forget to subscribe to planet-factor.

stesch
These plus the Google Tech Talk video referenced by Peter Mortensen below.
semperos
+4  A: 

I've been teaching myself Factor recently - I actually found Forth as a good afternoon's introduction to the concept of stack based languages (and as a bit of a software archaeologist, it's fun to step back a few years for a history lesson).

To that end I don't think it does any harm to take a few hours to install gforth or similar Forth implementation and start working through the first few chapters of starting forth or using ANS forth - I found it quite interesting, and because I only dipped my toe it hasn't taught me anything I've had to unlearn as I'm starting to learn factor.

Once I've progressed a little further in learning Factor I'll let you know what I've found useful (or not so useful!).

Bittercoder
+15  A: 

Factor is heavily inspired by Forth and other stack languages. It also grabs ideas from Lisp, and Smalltalk. From what I've read online, it's not necessary to learn any of those language before learning Factor. It won't hurt if you do, however :)

The biggest problems I've run into is the youthfulness of the language. In other words, code samples on various blogs/sites will be outdated because they used older versions of Factor (0.6, 0.7, 0.8, etc). Factor 0.9 and above are most likely to remain the same.

Once you get past the basics, the docs (online + in the listener) are pretty clear. The docs occasionally suffer from the same problem as blog posts: some outdated code examples. You still have the mailing lists/IRC to help out if you really get stuck.

I've only used the docs so far, instead of the mailing lists/IRC. I then experiment with the listener to further learn/explore a new concept I find in the docs.

This is the first language where most of my questions are answered just by digging into the docs of a function. Most of Factor is written in Factor, so things become clearer as you spend more time with the docs.

(The 2nd biggest problem I've had is trying to understand the web framework (Furnace). The web framework is more feature-rich that what I am used to. It's nothing impossible, just requires some practice and exploring the docs.)

The quickest intro. to concatenative languages I've found: http://github.com/raganwald/homoiconic/blob/master/2008-11-16/joy.md#readme

Your first steps to Factor: http://concatenative.org/wiki/view/Factor/Learning

These videos go into more detail regarding writing Factor code:

  • 90 minute video might help learning Factor basics: YouTube: Factor: An extensible, interactive Language - Basically, Slava (Factor creator) gives a video intro. to Factor. It's part of the Google Talk series. (There is a high and low quality version in case you can't see the slides.) Factor concepts are also compared to other languages.
  • 13 minute video: Forth @ RubyConf 2008. A brief demo of Forth. It also mentions some ideas that are common throughout the software world.
  • 100 minute video: Factor presented to Lisp programmers. Audio is not the best, but still very good video quality. If you watch the other videos, you can skip some of the beginning parts of this.

Some diversions:

Here are some blog posts that can help provide direction:

Understanding the various abstractions and libraries which are available is key to grasping Factor: collections, generic words, fry, locals, macros, memoization, PEGs, the prettyprinter, and so on. Making effective use of these tools can reduce the amount of work required to solve a problem by an order of magnitude.

Factor is definitely the most fun language. It has fewer surprises than other languages. I find it easier to learn than Ruby or Lisp. Just for fun, here is a language shootout between Lisp and Factor:

For anyone who is interested in stack-based languages, this article might help: The Joy of Catenative Languages (Parts 1, 2, 3) (It's more general and uses the Cat language for examples. It helped me with learning Factor basics.)

da01
+2  A: 

I think Slava Pestov's excellent presentation "Factor: an extensible interactive language" at Google (Google Tech Talk) counts as a good resource for learning Factor. There are lots of demos of the different aspects of Factor that you should be able to try on your system. For instance the demo of using Factor for implementing an Internet time server, approx. 1 h 07 min 20 secs and lexical closures, 46 min 35 secs. In fact most of the presentation is a demo.

The Flash video is 141 MB, 1 h 36 min 38 secs, presentation time autumn 2008. Slava Pestov is the creator of the Factor programming language and jEdit, a popular text editor.

Peter Mortensen
+1  A: 

I hope my interactive tool helps http://factor.openeducationtools.com

egaga