MiSawa / xq

Pure rust implementation of jq
MIT License
333 stars 18 forks source link

Tail call optimization #4

Closed MiSawa closed 3 years ago

MiSawa commented 3 years ago

We can abondan the current frame and create the new frame without increasing the stack if slots of the current frame won't be used. For example, if there's no references to a slot of the current scope from outside of the function.

Kinda related to this, we can skip creating a frame if there's no slots required for the scope.