3 ms·
Marking fixed stack size (and maybe even with an actual bound) would be helpful to ensure the tail-call optimisation is being done. I don't think any language
by dietr1ch 2y ago
Marking fixed stack size (and maybe even with an actual bound) would be helpful to ensure the tail-call optimisation is being done.
I don't think any language helps verifying that., and even in the ones that require it by spec, it's unclear if it's happening. Maybe you didn't really wrote a tail-recursive function because of a helper that you expected to be inlined. I guess it's easy to notice if you try to blow the stack in a unit test though.
- aapoalas 2y agoGuaranteed tail-calls with the `become` keyword have been moving forward recently.
- josephg 2y ago> Marking fixed stack size (and maybe even with an actual bound) would be helpful to ensure the tail-call optimisation is being done. Yeah, it seems like a pretty easy feature to add. The compiler can pretty easily calculate the maximum stack size for every (bounded) call stack. It seems super useful to compute & expose that information - especially for embedded devices.