GithubHelp home page GithubHelp logo

Comments (5)

lukewagner avatar lukewagner commented on June 17, 2024

Agenda item: naming/terminology (and what of ☃)

from interface-types.

lukewagner avatar lukewagner commented on June 17, 2024

Another agenda item: idea for how to avoid slices/views altogether (at least until wasm adds a first-class sliceref)

from interface-types.

jgravelle-google avatar jgravelle-google commented on June 17, 2024

Notes here

from interface-types.

PoignardAzur avatar PoignardAzur commented on June 17, 2024

Reading the notes, it sounds like the semantics of passing/returning slices was discussed, but no conclusion was reached? Did I get that right?

@lukewagner Is sliceref as a first-class type defined somewhere? Like, is there a public proposal, or is it an informal idea?

from interface-types.

lukewagner avatar lukewagner commented on June 17, 2024

In the call I basically just explained some recent thinking on whether we need slices/views. Namely:

  1. passing out a view to linear memory (as a typed array view or sliceref) is a pretty dangerous thing; it means that you now have to worry about the lifetime of that region of memory (with "use after free" bugs if the caller and callee don't agree)
  2. but a lot of Web APIs take views, where the host both reads and writes from/to the view
  3. a sequence-of-bytes interface value could be optimized to do no more copying than a view when calling a host API (with the right adapter expressions)

And thus perhaps we can leave out slices, at least from the initial proposal so that we can focus on the safer, more composable value semantics.

I'm afraid there's no written-up proposal for sliceref; it's just a very old idea that we assume we'll get around to at some point in time. The idea is basically to have a first-class typed array view that wasm can dynamically load and store from, ideally being able to point into both linear memory and ArrayBuffers (on the web).

from interface-types.

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.