MareOfNights@discuss.tchncs.detoProgrammer Humor@programming.dev•Some of my iterations are delightfully recursive
40·
7 months agoI never looked into this, so I have some questions.
Isn’t the overhead of a new function every time going to slow it down? Like I know that LLVM has special instructions for Haskell-functions to reduce overhead, but there is still more overhead than with a branch, right? And if you don’t use Haskell, the overhead is pretty extensive, pushing all registers on the stack, calling new function, push buffer-overflow protection and eventual return and pop everything again. Plus all the other stuff (kinda language dependent).
I don’t understand what advantage is here, except for stuff where recursive makes sense due to being more dynamic.
Interesting.
So it basically enables some more compiler magic. As an embedded guy I’ll stay away from it, since I like my code being translated a bit more directly, but maybe I’ll look into the generated code and see if I can apply some of the ideas for optimizations in the future.