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

Factor the JuvixCore -> JuvixAsm translation into JuvixCore -> JuvixTree -> JuvixAsm #2581

Merged
merged 7 commits into from
Jan 18, 2024

Conversation

lukaszcz
Copy link
Collaborator

This PR:

  • introduces the JuvixTree language which is like JuvixAsm except that instead of the value stack there is an applicative structure,
  • refactors the JuvixCore -> JuvixAsm translation into JuvixCore -> JuvixTree -> JuvixAsm.

JuvixAsm is a bit too low level for efficient compilation to Nock. Translating the value stack explicitly is a bad idea and it's unnecessary, because the value stack just represents an applicative structure which can be represented directly in Nock. It's possible, but cumbersome and unnecessary, to recover the applicative structure from JuvixAsm code. It's better to have a bit more high-level JuvixTree language which still retains the explicit applicative structure.

@lukaszcz lukaszcz added this to the 0.6.0 milestone Jan 16, 2024
@lukaszcz lukaszcz self-assigned this Jan 16, 2024
Copy link
Collaborator

@janmasrovira janmasrovira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review in progress

src/Juvix/Compiler/Asm/Pretty/Base.hs Outdated Show resolved Hide resolved
src/Juvix/Compiler/Asm/Pretty/Base.hs Outdated Show resolved Hide resolved
app/Commands/Dev/Core/Asm.hs Outdated Show resolved Hide resolved
src/Juvix/Compiler/Asm/Extra/Memory.hs Outdated Show resolved Hide resolved
src/Juvix/Compiler/Asm/Interpreter.hs Outdated Show resolved Hide resolved
src/Juvix/Compiler/Tree/Extra/Type.hs Outdated Show resolved Hide resolved
src/Juvix/Compiler/Tree/Extra/Type.hs Outdated Show resolved Hide resolved
src/Juvix/Compiler/Tree/Translation/FromCore.hs Outdated Show resolved Hide resolved
src/Juvix/Compiler/Tree/Translation/FromCore.hs Outdated Show resolved Hide resolved
src/Juvix/Compiler/Tree/Translation/FromCore.hs Outdated Show resolved Hide resolved
src/Juvix/Compiler/Tree/Translation/FromCore.hs Outdated Show resolved Hide resolved
src/Juvix/Compiler/Tree/Translation/FromCore.hs Outdated Show resolved Hide resolved
src/Juvix/Compiler/Tree/Translation/FromCore.hs Outdated Show resolved Hide resolved
src/Juvix/Compiler/Tree/Translation/FromCore.hs Outdated Show resolved Hide resolved
src/Juvix/Compiler/Tree/Translation/FromCore.hs Outdated Show resolved Hide resolved
@lukaszcz lukaszcz merged commit 91ba586 into main Jan 18, 2024
4 checks passed
@lukaszcz lukaszcz deleted the juvix-tree branch January 18, 2024 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants