<div dir="ltr">Hi Jesper, all,<div><br></div><div>Feature flags would be ideal if/when breaking changes are required if only</div><div>to resolve issues with having to relax warnings-as-errors which, as you say,</div><div>
is not good for those of us who prefer to be warning free.</div><div><br></div><div>But, feature flags introduce a maintenance concern if flags hang around</div><div>for too many releases. They should give offer time enough for code being</div>
<div>actively maintained to catch up, whilst being short-lived enough that the</div><div>language can evolve.</div><div><br></div><div>One of the first behavioural changes I quickly adopted when moving from</div><div>casual to daily erlang use was to enable all warnings and treat warnings as</div>
<div>errors.</div><div><br></div><div>Cheers,</div><div><br></div><div>Darach.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 27, 2014 at 11:06 PM, Jesper Louis Andersen <span dir="ltr"><<a href="mailto:jesper.louis.andersen@gmail.com" target="_blank">jesper.louis.andersen@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">Release 17.0 brings two changes which prove to take some work getting around.<div><br></div><div>1. utf-8 is now the default encoding.</div>
<div><br></div><div>This is a rather insignificant change. The source code which uses latin1 can be fixed by one of three ways:</div>
<div><br></div><div>* Tell the compiler the file is latin1. This won't work going forward but works now.</div><div>* Change the file to utf-8. This won't work going backward a long way. But it will work going backwards for a bit.</div>
<div>* Change the file to ASCII. This works both backward and forward as long as we want.</div><div><br></div><div>This is a benign problem. I have tried compiling some projects and it turns out there are numerous repositories which needs fixing now. But the fix is rather simple.</div>
<div><br></div><div>2. Dialyzer dislikes queue(), dict(), ...</div><div><br></div><div>Dialyzer now prefers using queue:queue() and the like. This is *definitely* the right thing to support as it is much more consistent with the rest of the system and doesn't treat certain types as magically introduced types.</div>
<div><br></div><div><div>-module(z).</div><div><br></div><div>-export([f/1]).</div><div><br></div><div>-spec f(queue:queue()) -> queue:queue().</div><div>f(Q) -> queue:in(3, Q).</div><div><br></div><div>Which is nice, but this doesn't work on R16B03:</div>
<div><br></div><div><div>z.erl:5: referring to built-in type queue as a remote type; please take out the module name</div><div>z.erl:5: referring to built-in type queue as a remote type; please take out the module name</div>
</div><div><br></div><div>So here, I have no way of getting my source code to work with both R16 and 17.0 easily. There is no transition period so-to-speak. Many projects run with warnings-as-errors and they are in trouble:</div>
<div><br></div><div>* They can't compile</div><div>* They can remove the warnings-as-errors but this defeats the purpose</div><div>* They will have warnings spewed out over the console all the time</div><div><br></div>
<div>In the case of crypto:hash/2, we had somewhat the same situation. Prominent projects like Yaws, and lesser projects like Emysql has EPP macros in place as well as detection in order to figure out what to do. Or you can disable the warnings in this case specifically for this. But can I do the same with wrong type specs? Also, this workaround is done in almost every project out there, which is darn irritating.</div>
<div><br></div><div>I don't know what we need to solve this. At one point, I would really like to have a set of feature flags </div><div><br></div><div><a href="http://www.lispworks.com/documentation/HyperSpec/Body/v_featur.htm" target="_blank">http://www.lispworks.com/documentation/HyperSpec/Body/v_featur.htm</a> , ZFS, ...<br>
</div><div><br></div><div>where you have a way to compile-time scrutinize what your environment supports. Another way to solve it is the variant Go uses, namely "build constraints"</div><div><br></div><div><a href="http://golang.org/pkg/go/build/#pkg-overview" target="_blank">http://golang.org/pkg/go/build/#pkg-overview</a><br>
</div><div><br></div><div>which will mention under which circumstances to include a file as a part of an application. This would allow for easy handling of crypto:hash/2, but I do note it will fail on the dialyzer problem. It looks like the only sane way to solve that is to allow both queue() and queue:queue() as aliases for a major release and then proceed to remove queue().</div>
<div><br></div><div>Am I completely wrong here? I can accept languages evolve and that Release 17 has maps which will be used and break a lot of software for R16 quickly. But I also feel we should have some way of having a process so there is a way to handle this gracefully going forward. It is natural for libraries and languages to evolve and break compatibility. Yet, it should be easy to handle for programmers. There is much time wasted, which could be used better were there a nice solution.</div>
<div><br></div><div>Thoughts?</div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br>J.
</font></span></div></div>
<br>_______________________________________________<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></blockquote></div><br></div>