Fwd: [erlang-questions] Re: data sharing is outside the semantics of Erlang, but it sure is useful

Witold Baryluk baryluk@REDACTED
Thu Sep 17 04:46:09 CEST 2009

Dnia 2009-09-15, wto o godzinie 22:38 +0200, Tony Rogvall pisze:
> > Here is nice term encoder/decoder (below) that will solve the size  
> > problem.
> > The algorithm is not efficient (in Erlang) but if/when implemented  
> > in C it could be used as a bif.
> > Still it will produce decent results on (all) shared data.
> >
> >

Wow, really nice work. Quickly and simple.

te module is really interesting. but still needs some optimazations in
encode function like finding variables which are used only once and
merging / propagating them into original structure.


it should be something more like:

where {l, X} means literal value of X.

or maybe even:

or even


depending what is "smaller"

I think that "optimization" of the output of the encode/1 function
can be done as separate pass after encode/1.

Witold Baryluk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: To jest cz??? wiadomo?ci podpisana cyfrowo
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20090917/fb180476/attachment.bin>

More information about the erlang-questions mailing list