[mercury-users] Erlang backend

Richard O'Keefe ok at cs.otago.ac.nz
Wed Feb 4 15:44:22 AEDT 2009


On 4 Feb 2009, at 5:17 pm, Peter Ross wrote:

> On Wed, Feb 4, 2009 at 10:25 AM, Richard O'Keefe <ok at cs.otago.ac.nz>  
> wrote:
>>
>> I am informed that
>> "In R12B, constant terms (for instance, {a,b,c,[e,f,g]} or  
>> {a,<<1,2,3>>})
>> are stored in a constant pool and not reconstructed every time.
>> That includes binaries. (The same mechanism is used for both
>> BEAM code and native code.)"

[so that if constant terms were the bottleneck,
  they are not any more.]

> Do you know if that include constant terms which contain closures?
>
> The RTTI includes closures which are the unification and comparison
> predicates for the given type.

Closures are not constants.
To a first approximation, if you could write '<<something>> in Scheme,
the Erlang version of <<something>> is a constant term.

I suppose a fun that _happened_ to have no free variables could be
thought of as a constant.  Can you provide me with some modest
examples of such terms?

I'm not sure what the interaction of such a feature with hot loading
should be like.

I've now had four different stories:
(1) it was because Erlang copied constant terms (it doesn't now).
(2) it was because Erlang copied constant terms containing binaries
     (it doesn't now).
(3) it was because Erlang didn't treat closures as constants.
(4) it was because Erlang wasn't good at strings.
I'm getting confused.

--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list