News for hackers. Stuff that matters.
Re:Introducing BERT and BERT-RPC: GitHub's new serialization... by jerf on Wednesday October 21, 2009 @06:20PM (#895764)
Is this intended to be put out for others to use? My reaction to it as an internal protocol is "OK, that's interesting" (I have my own streaming JSON message protocol myself), but putting it out for others to use clogs up an awfully full space (you'll note I'm not linking you to a "library" since my protocol isn't worth releasing).

One issue that leaps to mind (based on the fact my streaming JSON protocol also travels through Erlang as it happens) is what you do with dicts? Erlang's native representation for dicts is extremely hostile as a term to send to other languages:

    Erlang R13B01 (erts-5.7.2) [source] ...etc

    Eshell V5.7.2  (abort with ^G)
    1> dict:from_list([{"abc", "def"}, {"efg", "hij"}]).
    {dict,2,16,16,8,80,48,
          {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
          {{[],
            [["efg",104,105,106]],
            [],[],[],
            [["abc",100,101,102]],
            [],[],[],[],[],[],[],[],[],[]}}}
That's a hash with two entries, abc -> def and efg -> hij. Note that's the internal representation; dumping out a perl hash gives you a semantic-level representation but under the hood it too has dirty nasty bits like that.

If that's not easy, that's a big price to pay for moving binaries around, in general. In specific cases it could be fine.

Re:Introducing BERT and BERT-RPC: GitHub's new serialization... by evgen on Wednesday October 21, 2009 @06:34PM (#895793)
Why would you send an actual dict instead of a proplist? Every serialization protocol I am aware of does not send the actual internal dict/hash/map representation but instead flattens it down to what is effectively a list of key-value pairs that may or may not be tagged by the protocol as something to be reconstituted as a dict at the remote end. Looking at the spec it appears that this is what BERT does as well.
Re:Introducing BERT and BERT-RPC: GitHub's new serialization... by jerf on Wednesday October 21, 2009 @07:37PM (#895886)
Because the result in Erlang will not be a dict, it will be a list of key/value pairs. That's not the same.

Doing that automatically means you have to do something else to label it as a key/value list meant to back to a dict.

These are not insurmountable problems, just issues that have to be dealt with. Any problem in Erlang can be solved with another layer of record indirection, but those don't come for free.

I must not have looked closely enough to find the source; I did try.

Re:Introducing BERT and BERT-RPC: GitHub's new serialization... by bham on Wednesday October 21, 2009 @10:38PM (#896117)