2

Does Rascal do tail-call optimization? In particular, if I write code using tail recursion instead of those built-in loop construct, do I expect efficiency penalty?

1 Answer 1

3

Yes, you should expect efficiency penalty with the current implementation.

We do expect the compiler (which is being written now) to do tail-call optimization in the future.

3
  • Cool! Looking forward to that.
    – day
    Oct 15, 2013 at 20:41
  • 1
    Moreover, since there is a little bit of a call overhead, and the our immutable values, comprehensions are the fastest way to construct values. (currently!) Oct 16, 2013 at 7:02
  • A "little bit" of call overhead... ;-) Oct 17, 2013 at 6:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.