<div dir="ltr"><div>No; I built this from current `master@9ac8bdb`, it seems nothing changed, either erlc or c() from erlang shell still doesn't compile</div><div>it prompts error in line 213 of beam_asm.erl, but line 213 of this file doesn't have call to list_to_binary; as I read, it seems on #L245, the list_to_binary doesn't work with this list string `[16,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076,95,19990,30028,44],` because this string has chars (>255), it needs unicode:characters_to_binary can work</div><div><a href="https://github.com/erlang/otp/blob/master/lib/compiler/src/beam_asm.erl#L245">https://github.com/erlang/otp/blob/master/lib/compiler/src/beam_asm.erl#L245</a><br></div><div><br></div><div>Erlang/OTP 20 [RELEASE CANDIDATE 1] [erts-9.0] [source-9ac8bdb] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false]</div><div><br></div><div>Eshell V9.0 (abort with ^G)</div><div>1> c(hello).</div><div>hello.erl: internal error in beam_asm;</div><div>crash reason: badarg</div><div><br></div><div> in function list_to_binary/1</div><div> called as list_to_binary([[5,104,101,108,108,111],</div><div> [4,109,97,105,110],</div><div> [2,105,111],</div><div> [7,115,101,116,111,112,116,115],</div><div> [6,102,111,114,109,97,116],</div><div> [16,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076,95,19990,30028,44],</div><div> "\vmodule_info",</div><div> [6,101,114,108,97,110,103],</div><div> [15,103,101,116,95,109,111,100,117,108,101,95,105,110,102,111]])</div><div> in call from beam_asm:chunk/3 (beam_asm.erl, line 213)</div><div> in call from beam_asm:build_file/8 (beam_asm.erl, line 97)</div><div> in call from beam_asm:module/4 (beam_asm.erl, line 31)</div><div> in call from compile:beam_asm/1 (compile.erl, line 1370)</div><div> in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 329)</div><div> in call from compile:fold_comp/3 (compile.erl, line 355)</div><div> in call from compile:internal_comp/4 (compile.erl, line 339)</div><div>error</div><div><div>2> list_to_binary([16,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076,95,19990,30028,44]). </div><div>** exception error: bad argument</div><div> in function list_to_binary/1</div><div> called as list_to_binary([16,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076,</div><div> 95,19990,30028,44])</div><div>3> unicode:characters_to_binary([16,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076,95,19990,30028,44]).</div><div><<16,104,101,108,108,111,95,209,142,208,189,208,184,208,</div><div> 186,208,190,208,180,95,228,184,150,231,149,140,44>></div></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, May 5, 2017 at 5:35 AM José Valim <<a href="mailto:jose.valim@plataformatec.com.br">jose.valim@plataformatec.com.br</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I have ran the following on Erlang master, commit ffa80a4137:<div><br></div><div><div>$ curl <a href="https://gist.githubusercontent.com/anonymous/2e8babd349167a49eb6f6d55ec0505c9/raw/cee893bbcd1e9ade6e145c7f66b8599ab9dd6959/hello.erl" target="_blank">https://gist.githubusercontent.com/anonymous/2e8babd349167a49eb6f6d55ec0505c9/raw/cee893bbcd1e9ade6e145c7f66b8599ab9dd6959/hello.erl</a> | tail -n +2 > hello.erl</div><div>$ erlc hello.erl<br></div></div><div><br></div><div>And everything compiles just fine. Hopefully someone else can give it a try and let us know if they can reproduce the issue or not.</div><div><br></div></div><div class="gmail_extra"></div><div class="gmail_extra"><br clear="all"><div><div class="m_3227826491143417930gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div><br></div><div><br></div><div><span style="font-size:13px"><div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><b>José Valim</b></span></div><div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><div><span style="font-family:verdana,sans-serif;font-size:x-small"><a href="http://www.plataformatec.com.br/" style="color:rgb(42,93,176)" target="_blank">www.plataformatec.com.br</a></span></div><div><span style="font-family:verdana,sans-serif;font-size:x-small">Skype: jv.ptec</span></div><div><span style="font-family:verdana,sans-serif;font-size:x-small">Founder and Director of R&D</span></div></span></div></span></div></div></div></div></div>
<br></div><div class="gmail_extra"><div class="gmail_quote">On Thu, May 4, 2017 at 11:23 PM, derek <span dir="ltr"><<a href="mailto:denc716@gmail.com" target="_blank">denc716@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">like this gist? <a href="https://gist.github.com/anonymous/2e8babd349167a49eb6f6d55ec0505c9" target="_blank">https://gist.github.com/anonymous/2e8babd349167a49eb6f6d55ec0505c9</a></div><br><div class="gmail_quote"><div dir="ltr">On Thu, May 4, 2017 at 3:36 AM José Valim <<a href="mailto:jose.valim@plataformatec.com.br" target="_blank">jose.valim@plataformatec.com.br</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I have rebuilt Erlang from master and both the test and the code snippet you sent by e-mail works. In order to discard any encoding issue in the process, can you please push your code snippets to a repository?</div><div class="gmail_extra"></div><div class="gmail_extra"><br clear="all"><div><div class="m_3227826491143417930m_3268448190648262800m_4792840849669039973gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div><br></div><div><br></div><div><span style="font-size:13px"><div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><b>José Valim</b></span></div><div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><div><span style="font-family:verdana,sans-serif;font-size:x-small"><a href="http://www.plataformatec.com.br/" style="color:rgb(42,93,176)" target="_blank">www.plataformatec.com.br</a></span></div><div><span style="font-family:verdana,sans-serif;font-size:x-small">Skype: jv.ptec</span></div><div><span style="font-family:verdana,sans-serif;font-size:x-small">Founder and Director of R&D</span></div></span></div></span></div></div></div></div></div>
<br></div><div class="gmail_extra"><div class="gmail_quote">On Thu, May 4, 2017 at 8:04 AM, José Valim <span dir="ltr"><<a href="mailto:jose.valim@plataformatec.com.br" target="_blank">jose.valim@plataformatec.com.br</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi derek,<div><br></div><div>I have sent a PR that improves the coverage around this feature: <a href="https://github.com/erlang/otp/pull/1439" target="_blank">https://github.com/erlang/otp/pull/1439</a></div><div><br></div><div>The test currently passes on an old master reference. I will rebuild my development VM from master and follow up.</div></div><div class="gmail_extra"><br clear="all"><div><div class="m_3227826491143417930m_3268448190648262800m_4792840849669039973m_-8569974235234293892gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div><br></div><div><br></div><div><span style="font-size:13px"><div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><b>José Valim</b></span></div><div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><div><span style="font-family:verdana,sans-serif;font-size:x-small"><a href="http://www.plataformatec.com.br/" style="color:rgb(42,93,176)" target="_blank">www.plataformatec.com.br</a></span></div><div><span style="font-family:verdana,sans-serif;font-size:x-small">Skype: jv.ptec</span></div><div><span style="font-family:verdana,sans-serif;font-size:x-small">Founder and Director of R&D</span></div></span></div></span></div></div></div></div></div>
<br><div class="gmail_quote"><div><div class="m_3227826491143417930m_3268448190648262800m_4792840849669039973h5">On Thu, May 4, 2017 at 1:11 AM, derek <span dir="ltr"><<a href="mailto:denc716@gmail.com" target="_blank">denc716@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_3227826491143417930m_3268448190648262800m_4792840849669039973h5"><div dir="ltr"><div><br></div><div>I found this feature from some of the merged PRs of Erlang/OTP 20</div><div><br></div><div><a href="https://github.com/erlang/otp/blob/master/lib/stdlib/doc/src/unicode_usage.xml#L66-L71" target="_blank">https://github.com/erlang/otp/blob/master/lib/stdlib/doc/src/unicode_usage.xml#L66-L71</a><br></div><a href="https://github.com/erlang/otp/pulls?q=unicode" target="_blank">https://github.com/erlang/otp/pulls?q=unicode</a><div><br>> Erlang/OTP 20.0, atoms and function can contain Unicode characters<br></div><div><br></div><div>so I built the binary from git checked out source code (from revision efcb91bce) and play with it: it seems in escript interpreting mode it works, but compiling mode still has errors:</div><div><br></div><div><div>➸ cat ./hello.erl</div><div>#!/usr/bin/env escript</div><div>%% -*- coding: utf-8 -*-</div><div>%%! +pc unicode</div><div><br></div><div>-module(hello).</div><div>%-mode(compile).</div><div>-export([main/1, 'hello_юникод_世界'/0]).</div><div><br></div><div>main(_) -></div><div> % io:format("~p~n", [{io:printable_range(), io:getopts()}]),</div><div> % 'hello_'(),</div><div> io:setopts([{encoding,unicode}]),</div><div> % io:format("~p~n", [{io:printable_range(), io:getopts()}]),</div><div> 'hello_юникод_世界'(),</div><div> io:format("~tp~n", [{"Hello, 世界, юникод"}]).</div><div><br></div><div>'hello_юникод_世界'() -></div><div> io:format("~tp~n", [{'hello_юникод', <<"Hello, 世界; юникод"/utf8>>, "Hello, 世界; юникод"}]).</div></div><div><br></div><div><div>➸ erlang20 ./hello.erl</div><div>{'hello_юникод',<<"Hello, 世界; юникод"/utf8>>,"Hello, 世界; юникод"}</div><div>{"Hello, 世界, юникод"}</div></div><div><br></div><div>If I uncomment the "-mode(compile)." line, it just runs into compilation error (same as below shell compilation errors)</div><div><br></div><div>Or in the Erlang shell, trying to compile it just failed: (I have to remove (or comment out) the first "#!/usr/bin/env escript" line)</div><div><br></div><div><div>➸ erlang20</div><div>Erlang/OTP 20 [DEVELOPMENT] [erts-9.0] [source-efcb91bce] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false]</div><div><br></div><div>Eshell V9.0 (abort with ^G)</div><div>1> c(hello).</div><div>hello.erl: internal error in beam_asm;</div><div>crash reason: badarg</div><div><br></div><div> in function list_to_binary/1</div><div> called as list_to_binary([[5,104,101,108,108,111],</div><div> [4,109,97,105,110],</div><div> [2,105,111],</div><div> [7,115,101,116,111,112,116,115],</div><div> [6,102,111,114,109,97,116],</div><div> [15,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076,95,19990,30028],</div><div> "\vmodule_info",</div><div> [6,101,114,108,97,110,103],</div><div> [15,103,101,116,95,109,111,100,117,108,101,95,105,110,102,111]])</div><div> in call from beam_asm:chunk/3 (beam_asm.erl, line 213)</div><div> in call from beam_asm:build_file/8 (beam_asm.erl, line 97)</div><div> in call from beam_asm:module/4 (beam_asm.erl, line 31)</div><div> in call from compile:beam_asm/1 (compile.erl, line 1370)</div><div> in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 329)</div><div> in call from compile:fold_comp/3 (compile.erl, line 355)</div><div> in call from compile:internal_comp/4 (compile.erl, line 339)</div><div>error</div><div>2> </div></div><div><br></div><div>I have looked up in many of the commit messages, still not seeing a good example of how to use unicode in function names? Could some developer behind this feature give more examples?</div><div><a href="https://github.com/erlang/otp/blame/master/lib/stdlib/doc/src/unicode_usage.xml#L66-L71" target="_blank">https://github.com/erlang/otp/blame/master/lib/stdlib/doc/src/unicode_usage.xml#L66-L71</a><br></div></div>
<br></div></div>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div></blockquote></div>
</blockquote></div><br></div></blockquote></div>