That looks nice.  It looks like all I have to do is "bertify" my erlang term<br>and sent it to the browser, where it can be debertified.<div><br></div><div>The looks easier than going backwards and forwards via JASON mainly because there is no generic term_to_jason but there is a generic bert:encode and decode.</div>
<div><br></div><div>This should make life a *lot* easier.</div><div><br></div><div>I shall perform some experiments ...</div><div><br></div><div>/Joe</div><div><br></div><div><br><div><br></div><div><br><div class="gmail_quote">
On Tue, Nov 15, 2011 at 1:35 PM, Ulf Wiger <span dir="ltr"><<a href="mailto:ulf@feuerlabs.com">ulf@feuerlabs.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
If you can settle for BERT, I think there are some JavaScript implementations out there:<br>
<br>
<a href="https://github.com/rtomayko/node-bertrpc/blob/master/src/bert.js" target="_blank">https://github.com/rtomayko/node-bertrpc/blob/master/src/bert.js</a><br>
<br>
BR,<br>
Ulf W<br>
<div class="im"><br>
On 15 Nov 2011, at 12:57, Joe Armstrong wrote:<br>
<br>
</div><div><div></div><div class="h5">> I'd like to send a term_to_binary encoded term to a web client and decode it in javascript.<br>
><br>
> If I could do this it would eliminate the impedance mismatch between server-side databases<br>
> and client code in a browser. I want to totally eliminate conversions to and from JSON. Just send<br>
> raw blobs containing term_to_binary encoded data and pluck what I want in the client.<br>
><br>
> I would not necessarily want to decode the entire blob, I might just want to extract a specific item<br>
> So for example if In Erlang I created a blob by saying<br>
><br>
>       Blob = term_to_binary({thing,"foo","bar",["baz"]})<br>
><br>
> I'd like to send this to a browser and in Javascript say:<br>
><br>
>      var z = mylib_hd(my_lib_element(4,Blob))<br>
><br>
> Whereby z would be the javascript string "baz".<br>
><br>
> Has anybody implemented anything like this?<br>
><br>
> /Joe<br>
><br>
><br>
><br>
</div></div><div><div></div><div class="h5">> _______________________________________________<br>
> erlang-questions mailing list<br>
> <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br>
</div></div></blockquote></div><br></div></div>