[erlang-questions] Compiling functions returning large ground tuples

Kostis Sagonas kostis@REDACTED
Tue Feb 3 09:40:45 CET 2009


Richard O'Keefe wrote:
> I was enchanted to discover that the Mercury (strongly statically
> typed and moded logic programming with Clean-like uniqueness typing)
> system has an Erlang back-end.
> 
> I was less enchanted to discover that its originators
> "lost interest", mainly because they needed to generate
> functions that return large ground tuples.  In a message
> today, they said "those tuples (which can be rather large)
> would be reconstructed each time the function was called.
> HiPE was better, but (I think at that time) tuples
> containing binaries wouldn't be statically allocated."

IMHO, this is not a very good reason to "lose interest" in this project.
Also, if that was indeed the issue, they should have contacted us and we 
would have known about this and possibly have investigated whether 
something could have been done.

> I though the default compiler now generated code to make
> static copies of large ground terms.  Was I mistaken about
> that?  Did HiPE ever/does it now have any problem
> generating static copies of large ground terms containing
> binaries?

The current HiPE compiler (and for quite some time now, but I do not 
recall exactly from when) places structured terms with statically known 
subterms in a constant pool area.  This includes binary subterms.

Kostis



More information about the erlang-questions mailing list