[LLVMdev] OCaml and GC

Gordon Henriksen gordonhenriksen at mac.com
Sun Nov 25 11:31:54 PST 2007


On Nov 25, 2007, at 11:49, Jon Harrop wrote:

> On Sunday 25 November 2007 12:23, Gordon Henriksen wrote:
>
>> On 2007-11-24, at 21:58, Jon Harrop wrote:
>>
>>> - Garbage collection tuned for functional programming
>>
>> http://llvm.org/docs/GarbageCollection.html
>>
>> I've been doing some interesting work on this front. [..] Can you  
>> elaborate on what tuning you're looking for?
>
> Although F# is similarly expressive and fast for numeric code it is  
> slow for symbolic code because its run-time is inherited from .NET  
> and is tuned for C#. In ordinary imperative languages like C#,  
> values are rarely allocated and deallocated rapidly. However, in  
> functional languages like F#, the distribution of value lifetimes is  
> heavily geared toward a huge rate of allocation of very short-lived  
> objects. Consequently, idiomatic functional code often runs up to 5x  
> slower with F# than with OCaml because the .NET run-time is not  
> tuned for this.

The GC infrastructure in LLVM is agnostic to the runtime algorithms,  
so I believe it should be suitable here. It is not hampered by "one  
collector to rule them all." Though with one hand He giveth, and the  
other He taketh away: there is no default collector runtime, either.

— Gordon





More information about the llvm-dev mailing list