drom / wast-spec

WebAssembly AST specification
MIT License
9 stars 2 forks source link

(research) - shift AST format #4

Open wanderer opened 8 years ago

wanderer commented 8 years ago

could we possible use the shift AST format?
How would types be represented (i64, i32..)?
How would extending Shift to add rules for wast work?
cc @michaelficarra

drom commented 8 years ago

We can definitely learn from Shift AST Format. it is great format of JS. But in my opinion AST nodes should directly represent some elements of language, and any valid AST can be used to produce valid program in that language. Shift AST (or any other JS AST) have some things missing in WebAssembly, some things extra, and some things you can indirectly MAP. So, I don't think so.

wanderer commented 8 years ago

and some things you can indirectly MAP

yeah that is my instinct to. But it seems like there is a lot of shared semantics

wanderer commented 8 years ago

it would be intersting to define a mapping to shift or esperma from wasm ast. Is there a canonical why to do something like that? The obvious usecase here is transpiling wasm to JS.