Coder Social home page Coder Social logo

proposal-limited-arraybuffer's Introduction

Limited ArrayBuffer

Status

Champion(s): Jack Works

Author(s): Jack Works

Stage: 1

Presentations

Problem to be resolved

All of the following are helpful to archive the minimal permission/information principle.

  1. Cannot make an ArrayBuffer read-only.
  2. Cannot give others a read-only view to the ArrayBuffer and keep the read-write permission internally.
  3. Cannot give others a view that range limited (only a small area of the whole buffer is visible).

Design goal

  1. Freeze the ArrayBuffer.
    1. Like Object.freeze, there is no way back once frozen.
    2. Any TypedArray/DataView to the freezed ArrayBuffer is read-only too.
    3. [Optional] Keep frozen when sent across Realm (HTML intergration).
  2. Read-only TypedArray/DataView to a read-write ArrayBuffer.
    1. Must not be able to construct a read-write view from a read-only view.
  3. [Optional] Range-limited TypedArray/DataView to a read-write ArrayBuffer (CrimsonCodes0's use case on WebAssembly).
    1. Must not be able to construct a bigger view range from a smaller view range.
  4. Not adding too much complexity to the implementor.

Pros

  1. Minimal permission/information principle works on ArrayBuffer.
  2. Embedded JS engines can represent ROMs as read-only ArrayBuffer.

API design

See design.md

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.