

A panoramic tour of Factor - otoburb
http://andreaferretti.github.io/factor-tutorial/

======
mr_luc
I spent a full week of vacation time once playing around with Factor. It was a
real trip -- I'd been reading some of the Forth books the month prior for the
first time, and reading over jonesforth, and then when I began using Factor
the experience felt very civilized. Scripting-language feel, surprisingly good
performance, and very clean refactors.

It's not the same feel as the "virtuous abstraction" of macros in, say, Common
Lisp -- Factor has some very general abstractions that aren't always free
(whereas macros can be near-free. And though Factor has macros, I remember
feeling that I was somehow fighting Factor every time I wrote one). And the
documentation, through the REPL/docs browser that comes with Factor, is almost
terrifyingly complete ... and presented in a cross-platform GUI built on
OpenGL.

In short, Factor is one of those projects so all-encompassing and impressive
that you briefly fear that someone has "won" at hacking, and that the pastime
will shortly be retired.

But it has no package manager.

It seems amazing. They've solved so many other problems so beautifully. Why
not solve the one problem that (empirically, seems as though it) controls the
growth of open-source programming languages?

It's not a trivial thing, of course, to build a package manager. But it's
amazing, given the talents who have made Factor what it is, and what they've
accomplished, that no one has taken it on.

~~~
mrjbq7
We did start a conversation about building a package manager, but have not had
anyone champion this as a project. I admit to being a little lazy about this
due to including so much code in the main repository.

[https://gist.github.com/jckarter/3440892](https://gist.github.com/jckarter/3440892)

~~~
andreaferretti
I admit I have not read into detail the above specification, but I think that
an approach in the style of Metacello (from the SmallTalk community) would be
simple to develop and fit Factor nicely.

There need not be changes to the way vocabularies are loaded: instead one can
make some words that change the vocab roots according to some configuration
files. One could have a FACTOR-ROOT/cache directory in addition to work, core,
and extras, where packages are arranged by version. Then some machinery could
set the right vocab-roots based on a specification.

One would need

\- some words to create structure that describe packages (Maven-like). This
would allow to declaratively say that my project, at version x, consists of
this and that vocabulary, and relies on project foo at version y and project
bar at version z

\- some words to automate fetching the dependencies of my project recursively
from common repositories (one could start with github)

\- a word to set the vocab roots according to my dependencies

Ideally, I would like to write a configuration file that lists my dependencies
and then do something like

    
    
        USE: my project.config
        myconfig set-deps
    

On top of this, one could develop GUI tools to automate writing specification
files, or even suggesting officially endorsed packages. See for instance the
GUI tools in Pharo for a great example of this.

The advantage would be that we would not have any changes to the way
vocabularies are loaded, and the change would be much more incremental

------
toyg
Hey, I remember this! I'm surprised it's still going.

The original author, Slava Pestov, is the main developer behind jEdit, a
wonderful little editor. Slava is scary talented, but I remember thinking I
was just too dumb to wrap my head around Factor in any serious way.

------
jkarni
Huh? Why does Polish notation require parenthesis but Reverse Polish not? I
thought the whole point of Polish notation was that it didn't require parens.

Unless your operators don't have a fixed arity, anyhow (Lisp's don't). But
even then I don't see how RPN is in a better position...

~~~
Murk
I am not sure it does, but:

(7 + 2) * (2 + 5) in normal, infix notation

* + 7 2 + 2 5 in polish notation, [http://en.wikipedia.org/wiki/Polish_notation](http://en.wikipedia.org/wiki/Polish_notation)

vs reverse polish which is:

7 2 + 2 5 + * (or 7 2 25 + + * ) which is easy to evaluate, but not
necessarily to read)

~~~
jkarni
Sorry, I should have added some context:

>Notice that RPN requires no parenthesis, unlike the polish notation of Lisps
where the operator comes first, and RPN requires no precedence rules, unlike
the infix notation used in most programming languages and in everyday
arithmetic.

This seems wrong to me. It's the lack of variadic functions that is the
relevant difference to lisp in terms of doing away with parens, not PN vs RPN.

Love the article, though

------
Murk
Like the Dinosaur and the triangle symbol icon.

