Liste des Groupes | Revenir à cl forth |
..which doesn't deny use of variables where it's useful.Mr. Fifo - self-proclaimed "Mark Twain of Forth">
- has no idea, that writing Forth code doesn't
mean to move bytes around "Back and Forth"
(where did I see that? Let's see... :D ).
>
Stack jugglery means wasting CPU cycles for
moving the bytes around - it's contrproductive.
Variables have been invented to be used. They're
useful, if you didn't notice, or if they didn't
tell you that in your college, or wherever.
First, a stack has been invented to be used as well.
And a canonicalYou're sorry that you 'have' (IYO) to use the stack
Forth program uses the stack. Tut mir Leid.
If you want to use local variables, there are plentyContact me with your "recommendation" again when you
of languages that use that stuff. Like Python, the
language of champions.
Second, there are CPUs that are stack oriented - and using variablesYes, indeed - these CPUs have a stack, and what you've
should be wasteful in that case. There are also plenty of CPUs that have
a stack, like Z80, 8080 and friends. Sorry to say, but using ANY
instruction burns CPU cycles. There is no way around that.
Third, any statement must come with proof. And in this case that meansOh, really? That speaks in favor of the most clean solution.
extended benchmarking. I can tell you beforehand that I've never seen
significant differences between locals and stack. I'm sorry to say that
- but it's true.
Finally, you have to know that good software comes with MANY qualities,Yes, software comes with many qualities - and one of them,
speed being only one of them. If I have to choose between correct and
fast, there has to be a very convincing argument for the speed
requirement. They didn't tell you that in your college? Oh dear. I'm so
sorry for you! You must have had a miserable life.
Les messages affichés proviennent d'usenet.