[chbot] GCC and recursion

Mark Atherton markaren1 at xtra.co.nz
Sun Apr 14 03:07:09 BST 2024


Ha! I have already implemented RPN, and it works fine. This whole 
project is an experiment; interested to see what how far I can push 
things before the parser gets ugly.

I guess then next step is to write a small compiler running on an x86, 
generating P-code to be run on a *tiny* interpreter on the machine (and 
its associated 128 word limit). There is plenty of micro-code space, so 
might be able to dream up some complex instructions to make the 
interpreter very small.

Oh god, look what you have made me do now... :)


On 4/14/2024 12:06 PM, Charles Manning wrote:
> There is always an equivalent algorithm using arrays etc to make a 
> manual stack (ie. looping instead of function calling to get the 
> "recursion".).
> 
> Sometimes that's all you've got. eg. Fortran 77 etc does not provide 
> recursion because it is not stack based (like C).
> 
> Function calling recursion is a lot easier and cleaner though.
> 
> Have you considered just saying sod it and using RPN for your assembler? 
> Well for a first cut anyway.




More information about the Chchrobotics mailing list