<div dir="ltr"><div>1. A native loop is a loop that is not emulated via function calls.</div>2. I am planning on generating loops using plain jump instructions.<div>3. It shouldn't hang the VM any since, if I understand correctly, the thread can yield after any instruction is called.</div><div>4. What do you mean by, 'Did you measure that you actuall need such a thing?'</div><div>5. I have checked that the erlc compiler can handle it, and still benefit.</div><div><br></div><div>6. If I wanted to use HiPE, I would use it. Where's the fun in having HiPE do all my dirty work? I might integrate it into my language later on, but for right now I want pure BEAM.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 25, 2014 at 3:07 AM, Anthony Ramine <span dir="ltr"><<a href="mailto:n.oxyde@gmail.com" target="_blank">n.oxyde@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="auto"><div>What do you call native loops? Are you planning to generate BEAM code that loops using plain jump instructions? What do you do in that loop? Can you be sure your process will still yield in a cooperative fashion to not hang the VM? Did you measure that you actually need such a thing? Did you check that you will still be able to feed that assembly to the erlc compiler to benefit from the other usual instructions? In the end couldn't you just use HiPE to take care of these loops?</div><div><br></div><div>Regards,<span class="HOEnZb"><font color="#888888"><br><br>-- <div>Anthony Ramine</div></font></span></div><span class="HOEnZb"><font color="#888888"><div><br>Le 24 sept. 2014 à 23:36, Samuel Barney <<a href="mailto:samjbarney@gmail.com" target="_blank">samjbarney@gmail.com</a>> a écrit :<br><br></div></font></span><div><div class="h5"><blockquote type="cite"><div><div dir="ltr">I did look at targeting Core Erlang first, but it doesn't allow for native loops. I could emulate them with function calls, however, if I move down to the assembly level I can build loops with what is provided there.<div><br></div><div>Thank you for the information, I'll do some more searching to see what I can find.</div><div><br></div><div>Respectfully,</div><div>Samuel Barney</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 24, 2014 at 4:40 AM, Anthony Ramine <span dir="ltr"><<a href="mailto:n.oxyde@gmail.com" target="_blank">n.oxyde@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Did you try targeting Core Erlang first? Which primitives do you want to access in BEAM?<br>
<br>
There are 1024 X registers, and Y registers are used for locals in functions, to save them when calling other functions.<br>
<br>
You can find such information by reading the source code or various talk slides made by the OTP team these last years, but I can't help you find the links right now.<br>
<br>
Regards,<br>
<br>
Le 24 sept. 2014 à 04:40, Samuel Barney <<a href="mailto:samjbarney@gmail.com" target="_blank">samjbarney@gmail.com</a>> a écrit :<br>
<span><br>
> I'm developing a language on top of the Erlang VM, and there are a couple of flow-control constructs that I can't implement without skipping the Erlang AST and using the erlang assembly code.<br>
><br>
> Is there a specific amount of X and Y registers? Or is there a way that I can find that out via Erlang?<br>
><br>
> Also, what is the purpose of the Y registers?<br>
</span>> _______________________________________________<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" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br>
</blockquote></div><br></div>
</div></blockquote></div></div></div></blockquote></div><br></div>