-
Notifications
You must be signed in to change notification settings - Fork 147
wat: lisp-y text format for wasm #34
Comments
Hello there, I was wondering if you would like some help for this particular issue ? I would be glad to contribute to this project in my free time. |
hi @Spriithy yes. definitely yes! |
Thanks @sbinet for your consideration, After looking at the file format specification and based on the knowledge that From the above references, I think Schego and Zygomys looks quite robust. Anyways, what are the specifications for the wast format interaction ? Would it be meant for:
We should first better define the needs. |
I am not super familiar with the design space of lexers/parsers, so I can't answer your question about the generation of a pre-defined IR. The first and immediate value for a the official I'd like to closely reproduce this modus operandi. I think this involves being able to parse a I am not yet sure whether directly creating a what do you think? |
As stated in the official documentation, the
Anyways, after comparing a handful of To give you an idea, It's like a combination of the source file and the test file, if you want. It seems to me that parsing a |
Obviously, all the test suites from the official WebAssembly repositories are given as standalone Nevertheless, it would be interesting to have some external feedback / suggestions. |
Hey there, I allow myself to bump this issue to notify those interested that I am currently working on it. I plan to create a reviewable pull request that is not meant for immediate merge but rather see the advancement of the implementation and propose an early insight in my work. |
great! |
will not convert from `.wast` to `.wasm`. JS and C/C++ use the toolchains in their language because they exist, in Go we have wagon and plans to implement this here: go-interpreter/wagon#34 The hash we check, in any case, would be the hash of the `.wasm`, and that is what is checked on the blockchain when you `get code`.. it's the end reference for the code.
Just wondering, without knowing what I'm talking about: instead of building an assembler, have you considered at all using wabt through CGo? If you want to keep wagon buildable through |
Btw, another option for using
This directive could be put in a file gated behind a build flag, if the integration is designed in such a way that it is optional. |
well, the whole point of but I'd like to keep |
- `tokens.go`: Defines the Token type generated by the scanner and several utility functions around it - `test.wast`: A .wast test file extracted from [wasm's spec tests](https://github.com/WebAssembly/spec/blob/master/test/core/names.wast) - `scanner.go`: Implements the actual scanner and utilty functions regarding runes - `scanner_test.go`: A dead simple test case against the `test.wast` file. It doesn't verify correctness yet. - Added several new token kind constants to list different typed instructions such as `i64.reinterpret/f64` or `i32.add` - Implemented the `(*Scanner).scanTypedReserved()` method to identify well and ill-formed typed instructions - Better Scanner test interface, the test suite now takes a `-wast-file` flag that must point to the `.wast` file to Scan and test against. In order to test: - Create (or use a [`spec/test/core`](https://github.com/WebAssembly/spec/tree/master/test/core) ) wast file Updates #34.
to ease with sharing the spec tests with WebAssembly, we should be able to parse the
.wast
files.There are already a few Go-based lisp-y parsers/lexers:
The text was updated successfully, but these errors were encountered: