Comments (5)
Cool. Will try to remember to follow up later. In the meanwhile, this probably is not an issue for the reference types proposal. The GC or Design proposals might be better fits.
from reference-types.
That would indeed be cool. I'm not aware of any prior discussion about it in the context of Wasm. However, as you guessed correctly, it would require a much more sophisticated type system, and such type systems are prone to be super-hard to combine with a variety of other features (cf. Rust and the decade-long quest to iron out the details of its semantics). It might also be difficult to target by compilers. Altogether very much a research problem -- which I'd be very curious to see somebody tackling.
from reference-types.
@lukewagner and I were chatting about something like this in the context of Interface Types. But rather than guarantee safety through static types (because, as @rossberg said, that requires fairly sophisticated types), we would guarantee it through dynamic means in a way that would interact well with memory management. Anyways, we were halfway through the conversation when I got distracted by deadlines outside of wasm, but maybe we'll have something to get your thoughts on later.
from reference-types.
@RossTate My initial thought was being able to convert an regular ref into an owning ref when there's just a single reference to the value, but I wasn't sure that's viable with a tracing garbage collector.
Agreeing with @rossberg here, a type system is a no go. But, that being said, I'd love to see discussion about dynamically enforcing this.
from reference-types.
I am closing this, since it is outside the scope of the current proposal. If there is enough interest, somebody should start a follow-up proposal.
from reference-types.
Related Issues (20)
- [js-api] Formalization only: eliminate extern value cache HOT 7
- Who is responsible for table.grow? HOT 3
- `table.fill` needs to bounds check before executing `table.set`? HOT 3
- Missing validation step for ref.null HOT 3
- Typeability Bug in Reference Implementation HOT 5
- Evaluating initializer expressions in element segments when instantiating HOT 2
- Failure string in core tests HOT 1
- Bug in reference core test HOT 4
- "refedtype" unnecessary HOT 4
- Rename "refedtype" to "heaptype" HOT 1
- Missing design rationals for type annotated select HOT 3
- There is no DefaultValue for anyfunc/funcref HOT 1
- may have a wrong leading byte here HOT 1
- Constant Expressions constraint HOT 6
- Is there a browser support table? HOT 3
- [Support] Are mixed (`anyref`) tables still supported, and if so, how are they encoded? HOT 3
- s/anyref/externref in repo description HOT 3
- Archive repo? HOT 1
- New `select` variant is not documented in Overview HOT 1
- Remove type annotation on ref.is_null HOT 22
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 reference-types.