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

Binary Format #37

Closed
Horcrux7 opened this issue Aug 15, 2018 · 6 comments
Closed

Binary Format #37

Horcrux7 opened this issue Aug 15, 2018 · 6 comments

Comments

@Horcrux7
Copy link

Are there any ideas for a binary format? After a year this look all there vague.

@lars-t-hansen
Copy link
Contributor

I think the binary format depends on what the spec will be, and it's premature to commit to anything. There will be new kinds of data in the types section, and new opcodes, at a minimum; the POC that I'm implementing in Firefox has those. There may be new import and export entries.

@rossberg
Copy link
Member

The basic outcome of more recent discussion is embodied in PR #34 (@lukewagner, still blocked on your thumbs up ;) ). Still in flux is how exactly we want to model runtime types (i.e., downcasts). I agree with @lars-t-hansen that the details of the binary format are probably best decided last.

@kripken
Copy link
Member

kripken commented Nov 26, 2020

What's the status here? I'm looking to implement binary format support in binaryen, and I'm not sure if the overview is intended to be fully specified at this point?

If it is, then I'm a little unclear on what to do with "defined types" as mentioned there. Is the idea that a "defined type" is, like a function type, defined in the type section, and those all go in the index of types (so anything providing a type index can refer to them)? If so, are the only things in the type section now going to be function types, struct types, and array types?

@skuzmich
Copy link

There is a full temporary binary format described in this document. In was discussed in #81

It is supported in V8 engine, Kotlin compiler prototype, and partially in WABT. Last time I saw Firefox was adjusting its binary encoding to be compatible with the document.

@kripken you are correct about a single type index space. According to the document, types can be:

name +code -code immediate feature sm v8 wabt
func 0x60 -0x20 vec(valtype), vec(valtype)        
structtype 0x5f -0x21 vec(fieldtype) gc    
arraytype 0x5e -0x22 fieldtype gc    

@kripken
Copy link
Member

kripken commented Nov 27, 2020

Great, thanks for all the information @skuzmich !

Sounds like this issue can be closed then.

@kripken kripken closed this as completed Nov 27, 2020
@rossberg
Copy link
Member

@kripken, obviously, nothing is set in stone yet, but yes, the binary format section of the overview should be up to date and in sync with the V8 prototype (probably modulo a couple of recent changes). Also yes to your questions about "defined types" in the type section.

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

5 participants