<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Had not seen that before Felix—thanks for the link.<div class=""><br class=""></div><div class="">-Rick</div><div class=""><br class=""><div style=""><blockquote type="cite" class=""><div class="">On Aug 18, 2015, at 3:27 PM, Felix Gallo <<a href="mailto:felixgallo@gmail.com" class="">felixgallo@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">The redoubtable @jlouis666 has an excellent blog post about strings that may be of interest: <a href="https://medium.com/@jlouis666/erlang-string-handling-7588daad8f05" class="">https://medium.com/@jlouis666/erlang-string-handling-7588daad8f05</a><div class=""><br class=""></div><div class="">F.</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Aug 18, 2015 at 1:23 PM, Rick Pettit <span dir="ltr" class=""><<a href="mailto:rpettit@vailsys.com" target="_blank" class="">rpettit@vailsys.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Generally speaking, you probably want to use binaries these days as they consume far less memory (at least for “large” strings):<div class=""><br class=""></div><div class="">  <a href="http://www.erlang.org/doc/efficiency_guide/advanced.html" target="_blank" class="">http://www.erlang.org/doc/efficiency_guide/advanced.html</a></div><div class=""><br class=""></div><div class="">That goes for both sending over the wire as well as internally.</div><div class=""><br class=""></div><div class="">-Rick</div><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class=""><div class="h5"><div class="">On Aug 18, 2015, at 3:16 PM, Ben Hsu <<a href="mailto:benhsu@gmail.com" target="_blank" class="">benhsu@gmail.com</a>> wrote:</div><br class=""></div></div><div class=""><div class=""><div class="h5"><div dir="ltr" class="">Hello<div class=""><br class=""></div><div class="">I have a simple question, I know Erlang has strings and binary strings as separate data types, and they're different even if they "look the same" in the console</div><div class=""><br class=""></div><div class=""><div class=""><br class="">1> io:format(<<"fnord">>).</div><div class="">fnord</div><div class="">2> io:format("fnord").</div><div class="">fnord</div></div><div class=""><br class=""></div><div class=""><div class="">3> "fnord"==<<"fnord">></div><div class="">3> .</div><div class="">false</div></div><div class=""><br class=""></div><div class="">My question is when you will use each one. Are binary strings used for sending data over the wire, and normal strings used internally? what are the tradeoffs?</div></div></div></div>
_______________________________________________<br class="">erlang-questions mailing list<br class=""><a href="mailto:erlang-questions@erlang.org" target="_blank" class="">erlang-questions@erlang.org</a><br class=""><a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank" class="">http://erlang.org/mailman/listinfo/erlang-questions</a><br class=""></div></blockquote></div><br class=""></div></div><br class="">_______________________________________________<br class="">
erlang-questions mailing list<br class="">
<a href="mailto:erlang-questions@erlang.org" class="">erlang-questions@erlang.org</a><br class="">
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank" class="">http://erlang.org/mailman/listinfo/erlang-questions</a><br class="">
<br class=""></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></body></html>