Hello again, I hope I'll get some answer to my previous post, but in the neantime I have a question about optimizations.
I've been looking at SAC <https://www.sac-home.org/doku.php> , the amazing FP array language that has a 30 years mature optimizer, and the same number of users as ATS ;-) The main designer, Sven-Bodo Scholz, told me something that prompts my present post. I have a very simple kind-of fiboncacci loop inside loop, and some of the computations bear no effect on the result, and if I use : `sac2c`, the SAC compiler, it just CRUSHES `gcc -O3` (factor 100x in running time for the same result). So I asked Scholz how he managed it : "If you write some code that computes stuff that does not contribute in any which way to the results, it is nice if the compiler can get rid of it. FP ensures that all effects are explicit. Once the compiler knows all of them it can elide everything else. But in gcc it is very hard to figure out whether there is a hidden side-effect somewhere, therefore, the guys in general do not even bother to try for the simple cases." But I very often hear this about ATS : "oh, ATS actually doesn’t optimize anything, except tail calls, produces the c intermediate code, and thus leaves gcc do its job, which is like *awesome"* which to me sounds like (I may be wrong) : "people who optimize before passing the baby to gcc are like dummies” So why would ATS, which is functional, abandon its performance to gcc if it could do more (side-effects ?) optimizations thanks to being FP ? Is it because optimizing, like SAC, is a 30 years craft best left to future developers of ATS_n>=3 or is there something deeper ? Is it because ATS is a systems programming language, and thus cannot risk eliding stuff that could be elided in an array language like SAC ? Cheers, Yann -- You received this message because you are subscribed to the Google Groups "ats-lang-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/46d1534d-6221-4eea-a06e-707c13a719a0n%40googlegroups.com.