Re: Converting languages to a purely functional form

Joachim Durchholz <joachim.durchholz@web.de>
25 Jul 2003 21:14:20 -0400

          From comp.compilers

Related articles
Converting languages to a purely functional form dobes@dobesland.com (Dobes Vandermeer) (2003-07-15)
Re: Converting languages to a purely functional form joachim.durchholz@web.de (Joachim Durchholz) (2003-07-17)
Re: Converting languages to a purely functional form derkgwen@HotPOP.com (Derk Gwen) (2003-07-17)
Re: Converting languages to a purely functional form pat@jantar.org (Patryk Zadarnowski) (2003-07-21)
Re: Converting languages to a purely functional form vidar@hokstad.name (2003-07-21)
Re: Converting languages to a purely functional form lars@bearnip.com (2003-07-23)
Re: Converting languages to a purely functional form rivers@dignus.com (Thomas David Rivers) (2003-07-23)
Re: Converting languages to a purely functional form joachim.durchholz@web.de (Joachim Durchholz) (2003-07-25)
| List of all articles for this month |

From: Joachim Durchholz <joachim.durchholz@web.de>
Newsgroups: comp.compilers
Date: 25 Jul 2003 21:14:20 -0400
Organization: Compilers Central
References: 03-07-098 03-07-172
Keywords: analysis, functional
Posted-Date: 25 Jul 2003 21:14:20 EDT

Thomas David Rivers wrote:
> I though Appel had shown the equivalence of SSA-form and
> functional languages.
>
> If that's true - then you should be able to apply SSA-form
> algorithms to a function language to arrive at the same
> optimizations available there...
>
> Or - am I missing something?


Hmm... from what you write about Appel's result (I don't know much about
SSA myself), I'd say that the transformation of FPL code in SSA form
should be trivial.


FPL optimization slogans that I have seen are:
- Tail-call elimination (absolutely required for all FPLs)
- Automatic garbage collection (FPLs would be impractical without)
- Closure handling (important)
- Strictness analysis (for lazy FPLs)
- Compile-time evaluation (easier and more effective in an FPL)
- "Just generate good machine code directly if you want performance"
      (instead of going through C or interpreted bytecode)


I'm not sure, but I think that SSA form is used for much more
low-level optimizations (which would come in addition to the
above-mentioned ones for an FPL that compiles and optimizes right down
to the bare metal). It may well be that some SSA algorithms are
uninteresting for FPLs, because functional code has different usage
patterns than imperative code. Or vice versa: that there are
algorithms that would be helpful for functional code but haven't been
investigated too much because they aren't interesting for imperative
languages.


Regards,
Jo


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.