-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
feat(compiler)!: Add --memory-base
flag
#1115
Conversation
…onstant-valued primitives to reify these addresses in the runtime
@ospencer This appears to have not caused any snapshot changes. Is that not a bit weird? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! And it makes sense that no snapshots changed since the newly generated code should be exactly the same as the old code.
The major thing we need to fix is just that one Binaryen setting so it doesn't trash data in the space that you "reserved" 😂
A couple of tests would be good as well. The big one I'm interested in is starting with a memory base that's larger than the initial number of memory pages—I think we start with something like 64 pages. Just want to make sure that if you try to reserve more space than that everything still works.
Also, I believe you need to declare the new flag in the CLI so it can be used.
For the PR title, I think it's not bad really, but we do want to mark it as breaking in case anyone was depending on the static values, since they should use the primitives now. Maybe
feat(compiler)!: Add `--memory-base` flag
to highlight how to use it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One style question, but I was also wondering if the attributes are even needed if we land #1074?
--memory-base
flag
Hmm, we might still need the attributes, since the way we have it working right now would require |
That's a good point. Even less reason for this to be blocked 🙂 |
Co-authored-by: Oscar Spencer <oscar@grain-lang.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect!
Can you add |
Co-authored-by: Blaine Bublitz <blaine.bublitz@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work! Love that we're knocking 0.5 things down so quickly ❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good!
@@ -1406,25 +1422,80 @@ let transl_prim = (env, desc) => { | |||
| Not_found => failwith("This primitive does not exist.") | |||
}; | |||
|
|||
let diable_gc = [(Location.mknoloc("disableGC"), [])]; | |||
let disable_gc = [(Location.mknoloc("disableGC"), [])]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
Closes #1111. The introduction of the
attrs
result totransl_prim
felt a little awkward, but I think it was the cleanest way to slide this into the existing well-formedness checks in the compiler.Also, I'm open to better names for this PR.
Closes #935 (supersedes it)