From: | Tony Finch <dot@dotat.at> |
Newsgroups: | comp.compilers |
Date: | 18 Feb 2005 22:48:59 -0500 |
Organization: | dotat labs |
References: | 05-02-053 05-02-056 05-02-065 05-02-076 |
Keywords: | interpreter, code |
Posted-Date: | 18 Feb 2005 22:48:59 EST |
"Rodney M. Bates" <rbates@southwind.net> wrote:
>Tony Finch wrote:
>>"Rodney M. Bates" <rbates@southwind.net> wrote:
>>>
>>>The one exception is the functional languages, where functions can be,
>>>in effect, manipulated at runtime and then evaluated. ---
>>
>>That is not true for most modern functional programming languages
>>(i.e. ones not descended from lisp) which are designed to be compiled
>>to native code.
>
>I would expect many implementations to do some runtime partial
>evaluation when a curried function is partially applied. Does
>it never happen? I am sure this is sometimes more than an
>efficiency issue. Seems like it could affect termination,
>for example.
The usual implementation is that the partial application is converted
into a thunk which, when the remaining arguments are provided, calls
the function with all the arguments. If the partial application's
argument is statically constant then it may be partially evaluated at
compile time. The implementation cannot not have any effect on
termination, because that would be a bug.
Tony.
--
f.a.n.finch <dot@dotat.at> http://dotat.at/
Return to the
comp.compilers page.
Search the
comp.compilers archives again.