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

Forth is another good example. There’s no call and return, but it can be used to implement any algorithm.


> Forth is another good example. There’s no call and return

Huh? Could have fooled...well, everyone, including Chuck Moore.

Emphasis mine.

https://web.archive.org/web/20060101073958/http://www.colorf...

"The Data stack holds parameters for and results of subroutine calls. This distinction between control and data minimizes the cost of subroutine calls.

https://en.wikipedia.org/wiki/Forth_(programming_language)

"Forth is a procedural, stack-oriented programming language..."

"...where the user interacts via subroutines called words. "

"First a number (1 or 8) is pushed onto the stack, FLOOR5 is called,..."

"This is the same as what a processor's call/return instructions do."

https://www.forth.com/resources/forth-programming-language/

"The benefit of having a stack reserved for return addresses was that the other stack could be used freely for parameter passing, without having to be “balanced” before and after calls"

...




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: