Comments (6)
It was considered, but IIRC the original proposal was to hard-error on mismatching signatures instead of falling back to a slower path. My guess is that that would cause much more hesitancy than a performance cliff.
Are there better solutions?
from interface-types.
I'm not sure. It's probably worth pointing this out somewhere and perhaps in time also include a warning in the IDL specification itself to familiarize it among those writing specifications. With the goal that folks take even more care than usual to what gets written down.
from interface-types.
Good point. I think there is a way to address this:
- There will be a spec predicate "does this imported function 'match' this Web IDL Binding?" that determines whether the fast or through-JS path is taken (it's subtly semantically visible, so testable).
- This predicate could accept bindings that pass a subset of the imports' parameters when the extra parameters are marked optional (the semantics being to pass the default value).
- The guidance is thus (if it isn't already, which I bet it is), if you extend a method, make sure the new parameters are marked "optional".
This does require specializing a binding's generated stub to the callee, but I've been assuming that that is generally necessary in my mental model of the implementation, for a variety of reasons.
from interface-types.
This outline seems plausible, but this does not sound like a trivial relation to specify (and I imagine the implementation side would be even more complicated). About whether this is expressive enough: seems like this would catch cases like adding an entry to an enum
in the browser but not the application code, but not rephrasing checks from spec prose to IDL (e.g., WebAssembly/spec#977). cc @Ms2ger.
from interface-types.
I agree the relation will be complicated, but I think that is just inherent to the design, addressing not just this, but all the other bullets under Question #2 in the explainer that we discussed earlier.
Adding cases to enums or optional fields to dictionaries should independently fall out of the "structural subtyping" aspect of the design (mentioned in the Web IDL Types section of the explainer) of how value types are passed.
from interface-types.
Closing as out-of-date: the proposal no longer has the same sort of relationship to WebIDL as it did during this discussion. I don't think most of these concerns apply anymore. If I am incorrect, please re-open :)
from interface-types.
Related Issues (20)
- validateUtf8 typo in Explainer example HOT 1
- IT Mini-MVP? HOT 9
- Interface Types for self defined DataTypes HOT 1
- Define a "flags" interface type? HOT 6
- Interface type abbreviation for time? HOT 8
- Guaranteeing additional soundness properties HOT 11
- Unclear how adapting imports and acyclic instantiation works HOT 12
- Phase 2 estimate HOT 5
- Why is ByteString a string? HOT 3
- citability HOT 10
- NaN canonicalization HOT 39
- Why should strings be lists of Unicode Scalar Values? HOT 164
- Support UTF-16 as an additional encoding HOT 9
- Motivation for banning intertype recursion is not 100% clear HOT 12
- How possible is it to have two string types? HOT 14
- interface types versioning HOT 1
- Does flags enum type as be used typename or member name? HOT 1
- Where should `canonical_abi_*` be? HOT 4
- Backwards compatible additions to variants HOT 8
- Fixed-length lists HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from interface-types.