<div dir="ltr">Robert, the .beam file is made of a bunch of chunks. The abstract code is stored in a chunk named "Abst", where it is versioned and term_to_binary'ed. Literally:<div><br></div><div> erlang:term_to_binary({raw_abstract_v1, AST})<br></div><div><br></div><div>You can't/shouldn't store the core format here but you can create as many chunks as you want in the BEAM file. We actually do this in Elixir to store the documentation. At EUC, I talked to Björn Gustavsson about officially supporting a core chunk. Here is what we agreed on to the best of my memory:</div><div><br></div><div>1. We will have a new chunk named "Core" (they are all four letters)</div><div><br></div><div>2. The core AST will be versioned as well (raw_core_v1) and term_to_binary'ed, like this: erlang:term_to_binary({raw_core_v1, CoreAST})</div><div><br></div><div>I also talked to Kostis so dialyzer starts reading the core information from it too. Let me know if you go ahead with this so we can sync before I eventually send a PR to OTP and dialyzer.</div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="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">On Mon, Sep 21, 2015 at 2:14 PM, 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>When you compile a file with debug_info then the Erlang AST of the file is included in the .beam file. Does anyone know if the actual structure which is put in the file is checked for format? Can I put anything in there, for example the core code?<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888">Robert<br><br></font></span></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" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>