3 ms·
there are some important differences i just edited in a note about one of them, the scoping for large programs forth has namespaces (vocabularies or wordlists
by kragen 4y ago
there are some important differences
i just edited in a note about one of them, the scoping
for large programs forth has namespaces (vocabularies or wordlists) similar to static file scope in c
an important similarity between standard forth variables and c static variables is that they don't support recursion. in the occasional case where you do need recursion you can use the operand stack to save and restore your variables manually
x @ y @ ... recurse ...
y ! x !
which would not be possible in c with universal use of static global variables
also though typically when you are stepping through forth you are doing it by typing names of words, while in c you use the debugger, which can see and change local variables