-
Notifications
You must be signed in to change notification settings - Fork 4
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
[Feature] Adds importable memory. #42
base: main
Are you sure you want to change the base?
Conversation
Interesting! I like it! It’s definitely a feature we should have. |
@@ -80,6 +80,12 @@ defmodule Orb.Import do | |||
end | |||
end | |||
|
|||
defmacro register_memory(global, namespace, min \\ nil) do |
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.
Curious why register_memory/3
instead of memory/3
?
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.
Just seemed like the thing to do, I was frankly pretty tired when I wrote this so perhaps memory/3 would be more appropriate.
@@ -3,7 +3,7 @@ defmodule Orb.Memory do | |||
Work with memory: load, store, declare pages & initial data. | |||
""" | |||
|
|||
defstruct name: "", min: 0, exported_name: "memory" | |||
defstruct name: "", min: 0, exported_name: "memory", is_imported?: false |
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.
There‘s a bug from me where we aren’t using the exported_name
field in the wat output. So I should fix that.
I think generally it makes sense if you can export xor import, not both. So I’ll have a think about how best to represent that…
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.
Suggested resolution? Or needs some thinking?
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.
Sorry work has been super busy, I’ll resolve this soon!
What do you think of something like this for memory imports?