Hi Yann,
I will try to answer the questions you raised in an earlier post later.
Regarding optimizations, I find that feeding to gcc the C code generated from ATS source
is a reasonable choice. Yes, one could probably generate significantly more efficient code
by taking advantage of the rich type information inside ATS programs. But doing so is highly
non-trivial; it would require a very big effort.
Yes, the compiler of SAC can do amazing optimizations. But SAC as a programming language
often lacks features that can help construct efficient programs. Let me use a concrete example.
Say that I want to process all the lines in a given file. I could do this by calling fgets in a loop to
read in each line and process it, but this is very inefficient. I could do much better if I use mmap
to map the content of the file to some virtual address space, but this requires a lot more effort.
Naturally, I would expect a library function of some sort for fast processing lines in a file, but what
would be a good interface for such a function? Sometimes, I want to process all these lines sequentially,
and, sometimes, I want to process them in parallel. This is a very thorny issue in programming language
design. One key focus of ATS3 is on providing support for the programmer to write efficient code that
would often require much more effort if done elsewhere.
Cheers,
--Hongwei