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

Bring names in line with AST semantics sooner rather than later #26

Closed
titzer opened this issue Aug 25, 2015 · 13 comments
Closed

Bring names in line with AST semantics sooner rather than later #26

titzer opened this issue Aug 25, 2015 · 13 comments

Comments

@titzer
Copy link
Contributor

titzer commented Aug 25, 2015

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.

E.g.

type.operation
type.operation[type]

@kg
Copy link
Contributor

kg commented 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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

@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
Copy link
Member

I'll probably have plenty of time on the plane tomorrow, will do a first round of lining up naming.

@sunfishcode
Copy link
Member

@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
Copy link
Member

Are there any major discrepancies left?

@binji
Copy link
Member

binji commented Sep 18, 2015

Here are the ones I noticed: do_while, forever, continue, comma, conditional, call_direct.

@sunfishcode
Copy link
Member

do_while, forever, continue, comma, and conditional are under discussion in issues such as WebAssembly/design#223 and WebAssembly/design#299 .

The design's call_direct and the spec's call probably aren't waiting for anything though. Anyone want to state a preference?

@qwertie
Copy link

qwertie commented Sep 18, 2015

@sunfishcode call sgtm.

@sunfishcode
Copy link
Member

I submitted WebAssembly/design#365 to rename call_direct to call.

@sunfishcode
Copy link
Member

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!

alexcrichton pushed a commit to alexcrichton/spec that referenced this issue Nov 19, 2019
Specify allocation function by name instead of index
ErikMcClure pushed a commit to innative-sdk/spec that referenced this issue Jun 15, 2020
Use the intended variable in 'run a host function'.
dhil added a commit to dhil/webassembly-spec that referenced this issue Mar 22, 2023
This PR updates `resume_throw` such that it is parameterised by both
an exception and an optional filter list.

Co-authored-by: Andreas Rossberg <rossberg@mpi-sws.org>
backes pushed a commit to backes/spec that referenced this issue Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants