Giter VIP home page Giter VIP logo

Comments (4)

sunfishcode avatar sunfishcode commented on August 18, 2024

On call vs. call_import, there is an open design issue.

from spec.

titzer avatar titzer commented on August 18, 2024

FWIW in v8-native, we avoid having a heavyweight class-per-structure and
have a list of all opcodes and their input/output types (i.e. signature).
That is mostly because v8-native doesn't ever really reify the AST, but
decodes bytes directly either to validate or to generate an IR graph.

On Wed, Nov 25, 2015 at 12:59 AM, Dan Gohman [email protected]
wrote:

On call vs. call_import, there is an open design issue
WebAssembly/design#421.


Reply to this email directly or view it on GitHub
#194 (comment).

from spec.

rossberg avatar rossberg commented on August 18, 2024

FWIW, the nature of the else operand to if is quite different from the ones to br and friends. Conceptually, the else-less if is just a syntactic shorthand. Still, it makes sense to unify the conditionals in an internal AST (that's what the spec does as well).

The arguments to br, return et al are different, though. They stand for 0 or 1 value being passed. In a potential post-MVP extension with multiple return values, these would naturally generalise to n-ary lists. From that perspective, it does not make sense to treat different arities as separate operators, internally or externally.

In general, I'd argue that the factorisation of operators as described by AstSemantics is oriented more towards reflecting the concrete binary format and certain decoding considerations than what you'd likely represent with an actual AST. So it would seem natural to structure things somewhat differently in a real-world AST-based implementation.

from spec.

kripken avatar kripken commented on August 18, 2024

Thanks for the feedback, everyone. Ok, it sounds like there isn't really a "right" way to do this from the spec's perspective, and specific implementations might make different decisions. Not sure yet what I'll do in binaryen, but I lean towards optimizing the AST for code size.

from spec.

Related Issues (20)

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.