A panoramic tour of Factor
andreaferretti.github.io
andreaferretti.github.io
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.
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
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.
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...
(7 + 2) * (2 + 5) in normal, infix notation
* + 7 2 + 2 5 in 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)
>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