Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> tokens in Forth are always separated by spaces, like words.

So are arguments in LISP, but they still call them arguments.

'Word' was already taken by the processor folks, and we already had function/procedure/subroutine.

> "Function" would be inaccurate because they are not mathematical functions but procedures or "subroutines"

Sure, C functions aren't pure mathematical functions either. So? Function/procedure/subroutine are standard terminology. It's not all that confusing that a Haskell function doesn't behave the same way a C function does.

There are other options, like action/operation/method/event/verb/functor/transform. That Forth is stack-oriented doesn't really justify inventing a new term, to me at least.

Fun fact: the Factor programming language also uses 'word'.



In Moore’s unpublished 1970 book he says “subroutine” a lot and mostly references Fortran when comparing forth to other languages. He calls the input tokens “words” since they are delimited by spaces in a stream of other words. He builds a kind-of analogy by saying that words are given definitions in a forth dictionary. He also explicitly points out that he has used the same term “word” that they use for processor data size, to avoid any confusion.

All in all, I don’t think the terminology was considered as fixed as you seem to think it was in 1968. As you mentioned, people were misusing “function” as defined by centuries of mathematics... but because that caught on, your response to that is “so?” The weird things about forth did not stick, so they still seem weird today.


> So are arguments in LISP, but they still call them arguments.

I think (+(+ 1 2)3) is valid Lisp. The equivalent in Forth would be 1 2+3+, but it's not valid unless the word "2+3+" exists in your dictionary.


"word" was also taken by the machine architecture people. Nobody is confused between "three word structure" and "word processor".




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: