-
Notifications
You must be signed in to change notification settings - Fork 454
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
Rename grow_memory
and memory_size
?
#627
Comments
I like Will many things break if we change it? |
The names are referenced in the spec, and exposed to users in the text format. Browser's debuggers display these names too. But I'm guessing most things won't break because most users and tools don't consume or produce the text format. |
I'm guessing it's not a huge problem. But, one option is to prefer
`mem.size` and `mem.grow` as the canonical name, but continue to accept the
current names as aliases.
…On Mon, Dec 18, 2017 at 2:36 PM Ben Smith ***@***.***> wrote:
The names are referenced in the spec
<http://webassembly.github.io/spec/core/syntax/instructions.html#memory-instructions>,
and exposed to users in the text format
<http://webassembly.github.io/spec/core/text/instructions.html#memory-instructions>.
Browser's debuggers display these names too.
But I'm guessing most things won't break because most users and tools
don't consume or produce the text format.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#627 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGdJnKfqt0-266y7HAPfRrLoJ-EnN_eks5tBuj-gaJpZM4RGAcS>
.
|
While we're here: |
I prefer |
+1. If we do this before 1.0 is official we can get away with it. FWIW, I also prefer |
What have we shortened in the spec, versus spelled out fully? I think we should be consistent and choose |
@jfbastien, at least the core spec abbreviates to "mem" everywhere else. |
In long names we have Memory, Table, Global, reinterpret, call_indirect, etc. In shortened names we have varuint32, i32.const, eq / ne / lt / etc, clz, mul, div, rem, trunc. So we've been quite inconsistent! I don't care which way we go, but we should be consistent. We spell it "Memory" in the current spec, I'd expect memory operations to be spelled the same, but we could decide that all ops need to be abbreviated while object need to be spelled out fully? This is the tiniest of bikeshed anyways, I don't really care which way we go, but consistency seems missing and that's kind of embarrassing for a Standard (granted, we just accreted things over time and are just stamping them into the standard!). |
It seems like we've had a preference towards long names on the JS side of
things, where there seems to be more of a culture of that anyway.
For the instruction names, we've tended more towards abbreviations where
there are well-known ones, so `eq` for equal but not `rntrprt` for
reinterpret. Assembly languages also have a long history of using
abbreviations in their instructions.
In the context of assembly instructions, `mem` should be perfectly
recognizable, so it seems like going with `mem` over `memory` follows the
general rule of using abbreviations where they are well known.
…On Tue, Dec 19, 2017 at 9:04 AM JF Bastien ***@***.***> wrote:
In long names we have Memory, Table, Global, reinterpret, call_indirect,
etc.
In shortened names we have varuint32, i32.const, eq / ne / lt / etc, clz,
mul, div, rem, trunc.
So we've been quite inconsistent! I don't care which way we go, but we
should be consistent. We spell it "Memory" in the current spec, I'd expect
memory operations to be spelled the same, but we could decide that all ops
need to be abbreviated while object need to be spelled out fully?
This is the tiniest of bikeshed anyways, I don't really care which way we
go, but consistency seems missing and that's kind of embarrassing for a
Standard (granted, we just accreted things over time and are just stamping
them into the standard!).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#627 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGdJo0yJetmwsGDGYA4-7olOxRz1hYbks5tB-y1gaJpZM4RGAcS>
.
|
Sure, but the text format already uses |
Good point. Also, the current instructions are `grow_memory` and
`memory_size`, so in that light `memory.grow` and `memory.size` is closer
to what we've been doing.
…On Tue, Dec 19, 2017 at 10:32 AM JF Bastien ***@***.***> wrote:
In the context of assembly instructions, mem should be perfectly
recognizable, so it seems like going with mem over memory follows the
general rule of using abbreviations where they are well known.
Sure, but the text format already uses memory. Granted it's not an
instruction. I think we shouldn't be inconsistent.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#627 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGdJmmAhySNp8eWKIuMltFMLnu82lGgks5tCAFAgaJpZM4RGAcS>
.
|
These names are also exposed to users in various tools; clang has an intrinsic function named The only outstanding issue here is
As a way to move forward, I propose observing:
So the changes can be:
How does this sound? |
This aligns with current interest in using `mem.` prefix for memory operations, see WebAssembly/spec#627 and WebAssembly/threads#62 (comment).
PR #649 implements this suggestion for spec, interpreter, and tests. |
I just have a question from the point of view of an implementer; unlike WASM, WATF has no version or header. Wouldn't it be worth adding something like |
During the last meeting some participants did not like the shortening in the |
I thought the concern was more about the memory section being too short if we switched it to |
@littledan, there was a strong sentiment in the above discussion that both should be consistent, and I agree. |
As a random aside - if |
@NWilson, funny you bring that up, because I was just editing a comment to the same effect. Right now, it is not really clear what our overarching naming scheme for instructions is. With the proposed change, we have X. prefixes where X can be one of two things: (1) a value type, (2) an entity (one of the things that has either its own namespace or can be ex/imported). If we wanted to be more consistent, then we may also want to rename the *global and *local instructions. One could even argue that call_indirect should be renamed table.call, which seems in line with the table.get/set instructions proposed elsewhere. I don't have a good answer. It becomes even less clear when considering various future extensions. |
This seems like the best possible time to go over the MVP spec and all the upcoming extensions that have proposed their own new opcodes to come up with some kind of harmony and consistency. |
At the March 21st CG meeting, we discussed whether to choose |
This has landed. |
This follows the naming discussed in issue WebAssembly/spec#627.
As part of this update we needed to change the memory grow builtins. The version we used were removed in https://reviews.llvm.org/D56645 after (apparently) having been deprecated for some time. The newer versions match up with more recent versions of the WASM spec (see WebAssembly/spec#627 for more context). The WebAssembly/wabt version is also updated to the latest release to correct build issues with the older one and llvm 10. Upgrading should prevent a deadlock we saw periodically in the CI while building the OPA wasm binaries. Signed-off-by: Patrick East <[email protected]>
As part of this update we needed to change the memory grow builtins. The version we used were removed in https://reviews.llvm.org/D56645 after (apparently) having been deprecated for some time. The newer versions match up with more recent versions of the WASM spec (see WebAssembly/spec#627 for more context). The WebAssembly/wabt version is also updated to the latest release to correct build issues with the older one and llvm 10. Upgrading should prevent a deadlock we saw periodically in the CI while building the OPA wasm binaries. Signed-off-by: Patrick East <[email protected]>
--bikeshed warning--
As discussed here, we will likely add a suite of new memory operations,
mem.init
,mem.clear
,mem.copy
, etc.We could follow the current naming scheme and call these
init_memory
,clear_memory
,copy_memory
(ormove_memory
), but themem.
syntax is kind of nice, and mimics the style of other instructions. But then we have a bit of a naming wart withgrow_memory
andmemory_size
. Should we rename these tomem.grow
andmem.size
?The text was updated successfully, but these errors were encountered: