Update and getting on board
Philippe Le Hégaret, W3C
Topics
- Web Assembly
- Graphic
- How to contribute?
- Questions, discussions
Web Assembly Use Cases
- Higher performance games (Unreal, Unity)
- Audio and Video codecs / 3D model compression
- Google Earth
- Speech synthesis / recognition
- Media applications (Photoshop, After Effects, Maya, Blender, etc.)
- Bring existing C/C++ apps to the Web (Linux Stack, Emacs, Vim)
- Libraries for cryptography, computer vision
- Applications requiring reliable performance, blocking APIs, precise memory control
Web Assembly
- Bring "low-level" code to the Web (C/C++)
- Implementations shipped in Chrome, Firefox, Safari, Edge, NodeJS
- Support in Rust, C/C++, C#/.Net, Java, Python, Go
- Properties
- Binary format
- Stack machine + locals/globals with type constraints
- Structured control flow
- Linear heap (ArrayBuffer -> SharedArrayBuffer)
- On the Web, embedded in JS (WebAssembly object)
WASM Future
See WebAssembly/proposals
- Threads
- ECMAScript module integration
- BigInt<->i64 conversion in JS API
- 128-bit packed SIMD Extension
- Garbage collection
WebGPU
- GPU:
- rendering onscreen and offscreen drawing surfaces
- computation tasks
- Not a direct mapping of a native API
- Only a proposal, not on the standard track yet
- WSL: platform-neutral/portable Shading Language
- Could be implemented above Direct3D, Metal, or Vulkan.
- long-term direction to replace/complement WebGL
Contributing to the Web
- Explainer
- Find the right community/group
- WebIDL for APIs
- Step-by-step algorithms
- GitHub, Markdown, respec, bikeshed, etc.
- Get an early review w3ctag/design-reviews
- Write web-platform-tests (WPT) tests
Explainer
- What problem are you trying to solve?
- keep track of and make a note of alternatives which have been considered
- Be clear about the end-user need, first and foremost.
- The explainer is for everyone to read
- Check out the TAG documentation
Find the right community/group
You need to sell your idea
- Be open!
- Present your proposal in venuesL conferences, meetups, W3C TPAC
- W3C Community Groups: create your own (for bug ideas, like WASM, WebGPU) or use WICG
- Find other implementers
- Ask the W3C Staff for help in finding the right individuals to talk to
Web IDL for APIs
- interface definition language to describe API for the Web
- Best is to look at existing examples, like Payment Request API, Fetch, Intersection Observer
- Learn the design patternsL constructors, handlers, promises, etc.
- Make sure you know Javascript
specification
WebIDL for APIs
[SecureContext, Exposed=Window]
interface PaymentRequest : EventTarget {
constructor(
sequence<PaymentMethodData> methodData,
PaymentDetailsInit details,
optional PaymentOptions options = {}
);
[NewObject]
Promise<PaymentResponse> show(optional Promise<PaymentDetailsUpdate> detailsPromise);
readonly attribute DOMString? shippingOption;
}
WebIDL for APIs
[Exposed=(Window,Worker)]
interface Performance : EventTarget {
DOMHighResTimeStamp now();
readonly attribute DOMHighResTimeStamp timeOrigin;
[Default] object toJSON();
};
partial interface mixin WindowOrWorkerGlobalScope {
[Replaceable] readonly attribute Performance performance;
};
Step by step algorithm
Write the specification for implementers
The PaymentRequest(methodData, details, options) constructor MUST act as follows:
- If the current settings object's responsible document is not allowed to use the "payment" feature, then throw a "SecurityError" DOMException.
- Establish the request's id:
- If details.id is missing, add an id member to details and set its value to a UUID [RFC4122].
- Let serializedMethodData be an empty list.
- Process payment methods:
- If the length of the methodData sequence is zero, then throw a TypeError, optionally informing the developer that at least one payment method is required.
Tools
- Use GitHub to interact with your audience
- Explaier is written in markdown
- Specification should be written in respec or bikeshed
TAG review
- Get it as early as possible (complete explainer, draft of a spec). Do not wait!
- It's a two way communication
- Raise an issue w3ctag/design-reviews
- Check other issues for example
Write tests
- Unless you have tests, your feature won't get implementers traction
- web-platform-tests is the de facto Test project for the Web
- Consider adding WebDriver in your proposal if needed
- This helps writing your early implementation