Compiler friendly tail replication + tail reversal in ATS

What is the best way to check if a function has been optimized in an ATS optimized function? (So ​​far I have been working "from above" to find out if memory is constantly being used)

As a continuation: let's say you have a complex tail recursive function with which the compiler was unable to TCO, is there any way to rewrite it with a friendlier compiler? Or in this way make the compiler try to execute TCO?

+3
source share
1 answer

In ATS2, there is a special way to do this.

Say what you have

fnx foo(...) = bar(...)
and bar(...) = ...bar...

If the panel body contains a non-tail-recursive call to bar, then the C compiler should complain about the error message.

, () . , - , ( ): , ATS !

+2

Source: https://habr.com/ru/post/1694740/


All Articles