> Since my plan is to use Factor to take over the world and get > disgustingly rich, this is not an acceptable state of affairs. There > are two solutions: > > 1) Revive the old stack effect inference algorithm which did not > require annotations at all. > > 2) Require stack effect declarations on all words except for the most > trivial ones which only push literals on the stack > > I don't want to do #1 because the old algorithm was more complex, both > in terms of code and run time. So that leaves us with #2. I don't mind > having to annotate more words, what do you guys think?
It might make sense to require all definitions to have a stack effect, and have a shorthand parsing word for defining constant words. The CONST: word could ensure that the definition consists of nothing but literals and other const words, automatically apply "inline" and any other optimizer annotations that make sense, and maybe even figure out the types of the literals and annotate the stack effect with them. For example: CONST: FOO_BAR_BAS "foo" "bar" "bas" ; could expand out to: : FOO_BAR_BAS ( -- |string |string |string ) "foo" "bar" "bas" ; inline const ! etc. -Joe ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk