You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bring names in line with AST semantics sooner rather than later #26
Before we get too far along I think we need to have a referendum on the naming going on in the spec. In particular, I think the spec should follow naming conventions that have already been agreed upon in AstSemantics.md. Also, we should solve some of the outstanding issues with naming in AstSemantics.md.
In particular, the operation.type in the spec bothers me. This might come from a viewpoint where operations are parameterized over types in some way. That kind of doesn't make sense, since there are many floating point operations available that don't work on integers and vice versa. Therefore I think it's more logical to do what we were doing before and consider operations to be members of types.
We really need this. I've spent a while reading over the ml-proto and I still can't figure out how to mentally map name -> ast node -> name. The way it works currently is very confusing to me.
The biggest other discrepancy probably is with the zoo of conversion operators. One reason for the difference was that the naming in the AstSemantics is rather irregular, so kind of impossible to factorise in a pleasant manner. Can we perhaps do something about that?
Could you be more specific about the irregularity you observe? The current set of names is aimed at emphasizing semantic differences among the conversions.
@sunfishcode, I understand the motivation, but I'm not convinced it buys anything in a code format not targeted at humans anyway. In fact, find it rather difficult to memoize all the different names, and S-expr generators likewise will have to go through extra hoops to select them.
Conversions essentially form a 2D matrix (with a few holes; 3D if you want to count sign handling). It's unfortunate if different elements in this matrix require different naming schemes. (Or if both index dimensions are annotated in different ways, for that matter.)
@rossberg-chromium Humans finding it difficult to memorize all of the different names is a human-oriented concern :-). Using a single name to represent different kinds of things is an abstraction.
All compiler backends I'm familiar with (e.g. LLVM and GCC) use different opcodes to represent the different kinds of conversions, because there are significant semantic differences between them.
I think we've covered all the basic naming discrepancies between spec and design now, with the exceptions of several things which have open issues, such as those mentioned above, #65, etc.
Of course, if anyone finds any that we missed, please file a new issue!
Activity
kg commentedon Aug 25, 2015
We really need this. I've spent a while reading over the ml-proto and I still can't figure out how to mentally map name -> ast node -> name. The way it works currently is very confusing to me.
rossberg commentedon Aug 25, 2015
I'm fine with inverting the S-expr naming scheme in the proto. FWIW, it was inspired by good old M68k syntax, not by parameterisation.
rossberg commentedon Aug 25, 2015
The biggest other discrepancy probably is with the zoo of conversion operators. One reason for the difference was that the naming in the AstSemantics is rather irregular, so kind of impossible to factorise in a pleasant manner. Can we perhaps do something about that?
sunfishcode commentedon Aug 25, 2015
Could you be more specific about the irregularity you observe? The current set of names is aimed at emphasizing semantic differences among the conversions.
rossberg commentedon Aug 26, 2015
@sunfishcode, I understand the motivation, but I'm not convinced it buys anything in a code format not targeted at humans anyway. In fact, find it rather difficult to memoize all the different names, and S-expr generators likewise will have to go through extra hoops to select them.
Conversions essentially form a 2D matrix (with a few holes; 3D if you want to count sign handling). It's unfortunate if different elements in this matrix require different naming schemes. (Or if both index dimensions are annotated in different ways, for that matter.)
rossberg commentedon Aug 26, 2015
I'll probably have plenty of time on the plane tomorrow, will do a first round of lining up naming.
sunfishcode commentedon Aug 26, 2015
@rossberg-chromium Humans finding it difficult to memorize all of the different names is a human-oriented concern :-). Using a single name to represent different kinds of things is an abstraction.
All compiler backends I'm familiar with (e.g. LLVM and GCC) use different opcodes to represent the different kinds of conversions, because there are significant semantic differences between them.
lukewagner commentedon Sep 17, 2015
Are there any major discrepancies left?
binji commentedon Sep 18, 2015
Here are the ones I noticed: do_while, forever, continue, comma, conditional, call_direct.
sunfishcode commentedon Sep 18, 2015
do_while,forever,continue,comma, andconditionalare under discussion in issues such as WebAssembly/design#223 and WebAssembly/design#299 .The design's
call_directand the spec'scallprobably aren't waiting for anything though. Anyone want to state a preference?qwertie commentedon Sep 18, 2015
@sunfishcode
callsgtm.sunfishcode commentedon Sep 21, 2015
I submitted WebAssembly/design#365 to rename
call_directtocall.sunfishcode commentedon Sep 22, 2015
I think we've covered all the basic naming discrepancies between spec and design now, with the exceptions of several things which have open issues, such as those mentioned above, #65, etc.
Of course, if anyone finds any that we missed, please file a new issue!
Merge pull request WebAssembly#26 from WebAssembly/alloc-func-name
Merge pull request WebAssembly#26 from Ms2ger/iterator
Update `resume_throw` (WebAssembly#26)
Merge pull request WebAssembly#26 from WebAssembly/merge-upstream
Merge pull request WebAssembly#26 from WebAssembly/new-spec
Update repos (WebAssembly#26)
Merge pull request WebAssembly#26 from Ms2ger/iterator