<div dir="ltr"><div>The reason I would like to be able to handle multiple file types is to simplify checking systems with parts which are written in different languages.<br><br></div>Robert<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On 17 November 2014 18:19, Robert Virding <span dir="ltr"><<a href="mailto:rvirding@gmail.com" target="_blank">rvirding@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"><div><div><div><div>Something much naughtier and more basic.<br><br>- Make LFE local copies of the relevant dialyzer modules which have been hacked to be able to handle LFE files as input (with a new --lfe option)<br></div>- Run dialyzer using -pa to push the local module directory first so as to use these special modules instead of the standard ones<br><br></div>This will make it possible to use dialyzer on LFE files and other .erl or .beam files as well. Maybe with a little more hacking fix have multiple file types. Of course if dialyzer was to be opened up so that it would use the filename extension to pick the right versions of the functions Stavros mentioned then this would be much simpler. Wink, wink, nudge nudge. :-)<br><br></div><div>This is my plan anyway.<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div><br></div>Robert<br></font></span><br></div>P.S. Having LFE generate erlang AST has never been an option as it is very close to core and it would take a lot of effort to go back to erlang which would then be undone by the erlang compiler.<br><br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 17 November 2014 17:49, 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">Robert, what would a specialized version of dialyzer entail? A fork? A specific front-end? Curious. :)<span></span><div><span><br>On Monday, November 17, 2014, Robert Virding <<a href="mailto:rvirding@gmail.com" target="_blank">rvirding@gmail.com</a>> wrote:<br></span><div><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Ah, so then in principle I can make my own specialised versions of the dialyzer load modules which takes the core which the LFE compiler generates and extracts the core and the type/spec data dialyzer needs. This without any Erlang AST which LFE never generates anyway.<br><br></div>Now we are getting somewhere useful. With this we don't really need to be able to store core in the .beam files if we can accept using source files as input.<br><br></div>Robert<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On 17 November 2014 17:32, Stavros Aronis <span dir="ltr"><<a>aronisstav@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">For .erl files, dialyzer calls the compiler with 'to_pp', which stops the compilation before code is converted to Core, and reads attributes from there.<br><div><br></div><div>Judging from v3_core, line 170 the two representations should be compatible.</div><span><font color="#888888"><div><br></div><div>/Stavros</div></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 17, 2014 at 5:11 PM, Robert Virding <span dir="ltr"><<a>rvirding@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"><div>From where does it get it if I have .erl files as input? From the AST as well? Do you know if there is any difference in the data itself between the AST and core? I am guessing not but want to check. If there is no difference then the info could be gotten from Core. This would make it easier to use dialyzer together with LFE.<span><font color="#888888"><br><br></font></span></div><span><font color="#888888">Robert<br><br></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On 17 November 2014 17:03, Stavros Aronis <span dir="ltr"><<a>aronisstav@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">Hi Robert,<div><br></div><div>Dialyzer gets this info from beam_lib:chunks(File, [abstract_code]) which corresponds to the AST and is included in beam files if +debug_info is used while compiling.</div><div><br></div><div>To my knowledge there is no reason to not let sources be combined (except perhaps when building a PLT), but the implementation seems to require uniformity.</div><div><br></div><div>Relevant functions: dialyzer_utils:get_abstract_code_from_{src,beam}/{1,2}, get_spec_info/3, get_record_and_type_info/1.</div><div><br></div><div>Regards,</div><div><br></div><div>Stavros</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Mon, Nov 17, 2014 at 4:53 PM, Robert Virding <span dir="ltr"><<a>rvirding@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><div dir="ltr"><div>From where does dialyzer get the user added type and spec info? From the AST, or from Core erlang which contains the same type/spec data? And why? Can I control it?<br><br></div><div>An extra question: why doesn't dialyzer allow me to mix input from both .erl and .beam files? Or does it and I have missed that?<span><font color="#888888"><br><br></font></span></div><span><font color="#888888">Robert<br><br></font></span></div>
<br></div></div>_______________________________________________<br>
erlang-questions mailing list<br>
<a>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>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</blockquote></div></div></div><br><div><div><br>-- <br><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 Lead Developer</span></div></span></div></span></div><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>