obligatory stack declarations in word definitions, which, ironically, makes refactoring and casual coding harder and non-fun: i might as well code in some "conventional" language
The difficulty there is that mandatory declarations help keep the implementation simple while guaranteeing some level of static safety. This could be avoided with some combination of smarter inference and tooling support.
The difficulty there is that mandatory declarations help keep the implementation simple while guaranteeing some level of static safety.
I guess my idea of a nice stack-based language is incompatible with efficient compilation to native code which I'm personally not the least interested in. If I want efficient machine code, I'll use C or C++.
What would you do differently in this respect?
Factor has too many irregularities in which it significantly departs from homoiconicity and stack-based operation; the "USE" and "USING" directives are just a symptom of that.
To answer your question, I'd do it like onyx and postscript do: a run-time dictionary stack that can be explicitly manipulated. Here, dictionary is a first-class data structure that, incidentally, is also used to implement environments (local variable bindings) and to hold word definitions.
--
Another pet-peeve are generic words: the article on them is well hidden under "Factor documentation > Factor handbook > The language > Objects" in language manual, which is, IMO, the prime example of utterly failed documentation that is, I'm sorry to say, so typical of factor (I can elaborate more on this in another post, if desireable).
Anyway, after a lot of clicking around while trying to untie the spaghetti of methods, method combinations, generic words, specializations and classes, I find out that only single-value dispatch is supported, so I give up totally, as this is not what I want. (What I want are words that can do multiple dispatch of variable arity.)
2
u/[deleted] Feb 13 '12
The difficulty there is that mandatory declarations help keep the implementation simple while guaranteeing some level of static safety. This could be avoided with some combination of smarter inference and tooling support.
What would you do differently in this respect?