Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translation from JuvixAsm to Nock #2559

Closed
lukaszcz opened this issue Dec 10, 2023 · 1 comment
Closed

Translation from JuvixAsm to Nock #2559

lukaszcz opened this issue Dec 10, 2023 · 1 comment
Assignees
Milestone

Comments

@lukaszcz
Copy link
Collaborator

lukaszcz commented Dec 10, 2023

  • Implement translation from JuvixAsm to Nock.

    One can use the argument on the left of * in the Nock evaluation function as a stack. The Nock stack would need to contain (from bottom to top): pointer to stdlib, pointer to JuvixAsm compiled functions, the function arguments (JuvixAsm argument area), the value stack and the temporary stack mixed together. Each function can have a separate Nock stack - on function call a new stack is created which initially contains the new arguments and a pointer to compiled functions and stdlib at the end (bottom). In the translation, one needs to keep track of the current value and temporary stack heights and adjust the references to temporaries, arguments and function symbols accordingly. JuvixAsm constructors can be represented by Nock terms with the tag in the head, e.g., cons 1 (cons 2 nil) would be [cons 1 [cons 2 nil]] with unique numbers used for the tags cons and nil.

  • Test the compilation pipeline to Nock with the Nock evaluator.

  • Depends on Nock language and evaluator #2557

  • Depends on Implement the dynamic dispatch loop in JuvixAsm #2555

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants