[erlang-questions] Question about the VM

Samuel Barney samjbarney@REDACTED
Thu Sep 25 21:17:44 CEST 2014


1. A native loop is a loop that is not emulated via function calls.
2. I am planning on generating loops using plain jump instructions.
3. It shouldn't hang the VM any since, if I understand correctly, the
thread can yield after any instruction is called.
4. What do you mean by, 'Did you measure that you actuall need such a
thing?'
5. I have checked that the erlc compiler can handle it, and still benefit.

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.

On Thu, Sep 25, 2014 at 3:07 AM, Anthony Ramine <n.oxyde@REDACTED> wrote:

> 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?
>
> Regards,
>
> --
> Anthony Ramine
>
> Le 24 sept. 2014 à 23:36, Samuel Barney <samjbarney@REDACTED> a écrit :
>
> 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.
>
> Thank you for the information, I'll do some more searching to see what I
> can find.
>
> Respectfully,
> Samuel Barney
>
> On Wed, Sep 24, 2014 at 4:40 AM, Anthony Ramine <n.oxyde@REDACTED> wrote:
>
>> Did you try targeting Core Erlang first? Which primitives do you want to
>> access in BEAM?
>>
>> There are 1024 X registers, and Y registers are used for locals in
>> functions, to save them when calling other functions.
>>
>> 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.
>>
>> Regards,
>>
>> Le 24 sept. 2014 à 04:40, Samuel Barney <samjbarney@REDACTED> a écrit :
>>
>> > 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.
>> >
>> > Is there a specific amount of X and Y registers? Or is there a way that
>> I can find that out via Erlang?
>> >
>> > Also, what is the purpose of the Y registers?
>> > _______________________________________________
>> > erlang-questions mailing list
>> > erlang-questions@REDACTED
>> > http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140925/7dc8636b/attachment.htm>


More information about the erlang-questions mailing list