Git Product home page Git Product logo

wast-spec's Introduction

wast-spec's People

Contributors

drom avatar wanderer avatar

Stargazers

dp avatar  avatar Preston Garno avatar  avatar  avatar Anqur avatar Miaojiang (MJ) Deng avatar 题叶 avatar Art Scott avatar

Watchers

Art Scott avatar  avatar James Cloos avatar  avatar  avatar

Forkers

cequencer

wast-spec's Issues

naming; change if, consequent, alternate

Currently we have

{
  kind: 'if',
  test: <expr>,
  consequent: <expr>,
  alternate: <expr> | null
}

But most WASM documentation refers to then and else
so what about ?

{
  kind: 'if',
  test: <expr>,
  then: <expr>,
  else: <expr> | null
}

identifier id -> string?

so it might be a little bit more consistent if we went from identifier.id to identifier.string and change literal.raw to literal.string

literal mess

Having one kind of literals is sort of confusing.
We can split them:

  • literalString --> value: String
  • literali32 --> value: Number
  • literalf32
  • literalf64
  • literali64 --> value: [ Number, Number ] (low, high) parts of number

Places to change:

  • *.id ... | -> |
  • export.name ... ->
  • store.addr ... String -> <literal{i32,i64}>
  • store.data ... String -> <literal{i32,i65,f32,f64}>
  • invoke.name ... | ->
  • *.failure: ... ->
  • import.{modName,funcName} ... ->
  • const.init ... -> <literal{i32,i64,f32,f64}>

are empty nodes required?

if you have like an empty block

{ 
  "kind":"block",
  "id":null,
  "body":[ ]
}

If the empty keys were dropped would it still be valid according to the spec? So like this

{ 
  "kind":"block"
}

Items in param

so item here should be a type

{
  kind: 'param',
  items: [ <item> ]
}

would this make sense?

{
  kind: 'param',
  items: [ <type> ]
}

distinguish Object and Array properties

We have 2 type of node hierarchical properties:

  1. Object -- scalar child
  2. Array -- vector child

it should be possible to know type of the property value by name of the property key, like:

  1. id, expr, init, test, consequent, alternate, left, right, result, module, failure, invoke -- Object
  2. body, items, params, local, segment -- Array

Find all mismatches and fix.

  • func.param -> func.params
  • br_table.expr -> br_table.SOMETHING_ARRAY_LIKE

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.