what blows my mind is that if you have side effects in your semantic actions, it is best to collect first a parse tree of thunks, then on a correct parse you execute the megathunk which explodes and reproduces a syntax tree.
Thunks are actually generalized across programming language theory, and I believe the term came about with the advent of Algol 60. Originally, it referred to the scratch space allocated by a compiler to compute expressions provided as formal parameters. In compilers, we referred to it as anything providing a return address following a jump, although this conflicts with the definition we used in comparison of programming languages.
These days, I'd feel comfortable using it to refer to any space allocated for an expression which may or may not be evaluated.
Comments 3
Reply
Reply
These days, I'd feel comfortable using it to refer to any space allocated for an expression which may or may not be evaluated.
Thank for inviting me to soup night :/.
-Nick
Reply
Leave a comment