gforth
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Inquiry about return stack and function call implementation in Gforth


From: Jack Luo
Subject: Inquiry about return stack and function call implementation in Gforth
Date: Thu, 29 Aug 2024 00:43:28 +0000

Dear Gforth Users and Development Team,

My name is Jack, and I am a Mphil. Student at University of Sydney doing 
research about fast fuzzing techniques. I am currently working on a project 
that involves deep understanding of Forth's return stack mechanics, 
particularly in Gforth.

I am writing to inquire about the specific implementation details of the return 
stack in Gforth. Specifically, I am interested in:


  1.  How is the return stack physically implemented in Gforth?
2. Are there any design documents or detailed explanations available about the 
return stack's implementation?
3. How are function calls (words) implemented in terms of stack operations? 
Specifically:

a. What exactly happens on the return stack when a word is called?
b. How is the return address handled during word execution and return?
c. Are there any special considerations for tail-call optimization in Gforth?

 I have already consulted the Gforth manual and attempted to search through the 
source code, but I haven't been able to find the specific information I'm 
looking for. I'm particularly interested in understanding how to potentially 
implement unconditional jumps or optimize tail-recursive calls using return 
stack manipulation. Any insights or directions you could provide would be 
greatly appreciated. If there are source files or documentation I should be 
looking at, please let me know. Thank you for your time and for your work on 
Gforth.

Best regards,
Jack.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]